0
HELP : How can I [‘0.3’, ’10**2’] ==> [0.3, 10**2]
n = ['1' , '-2' ,'0.3' ,'10**2'] I want to change to this↓↓ m = [1, -2, 0.3, 10**2]
3 Answers
+ 1
for i in n:
i = int(i)
0
It’s going to be error when i is ‘0.3’ and ‘10**2’
0
Dangerous one:
for i in n:
i = exec(i)