0

Error was occoured like below in python.

[1,2,3]*1e-6

TypeError: can't multiply sequence by non-int of type 'float'

How can I fix this?

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Addung
  • 1
  • Advisory for the duplicate closers: [Why do I get TypeError: can't multiply sequence by non-int of type 'float'?](https://stackoverflow.com/questions/35166633/) **should not** be used as a dupe target for questions like this, where there is a deliberately created list. That question is itself a duplicate of the canonical, [How can I read inputs as numbers?](https://stackoverflow.com/questions/20449427), for cases where one operand is a *string from user input* (which was intended to be also a number). – Karl Knechtel Oct 23 '22 at 03:29

1 Answers1

0
import numpy as np
ls=[1,2,3]
ls=np.array(ls)*1e-6
print(ls)

Hopefully this will work

Vashdev Heerani
  • 660
  • 7
  • 21