0
What's wrong with this code??
3 Answers
+ 1
Corrected:
num_1,num_2=[float(v) for v in input("enter the value of num_1 and num_2 seperated by commas").split(",")]
print(num_1)
print(num_2)
average=(num_1+num_2)/2
print("average is "+str(average))
float() takes an integer or a string but you can't pass it a list like you were trying to
+ 1
as others have mentioned the issue,
so you need to loop manually and type cast the inputs or map the float() for each inputs
num_1,num_2 = map(float,input("enter the value of num_1 and num_2 seperated by commas").split(","))
https://code.sololearn.com/cuVL0wRuSSR6/?ref=app