num1 = "3.2, 2.4, 99.8"  
tupl1 = tuple(float(i) for i in num1.split(","))   

But when I execute it, it shows 'generator' object is not callable.

When using this explanation:

num1 = "3.2, 2.4, 99.8"
list1 = list(float(i) for i in num1.split(","))

But when I execute it, it works as I plan. [3.2, 2.4, 99.8]

Could I know the reason. Appreciate the guide.

0

There are 0 best solutions below