-1

I'm trying to do something like:

([0.01]*9).append(0.91)

to get to:

[0.01, 0.01, 0.01, 0.01, ...., 0.91]

Is there a way to do this in one line rather than:

temp = [0.01]*9
temp = temp.append(0.91)
Willem Van Onsem
  • 443,496
  • 30
  • 428
  • 555
user1357015
  • 11,168
  • 22
  • 66
  • 111

1 Answers1

1

Simply concatenate to the list

 temp = [0.01]*9 + [0.91]
isopropylcyanide
  • 423
  • 4
  • 16