0

what is the meaning of str in line 4 ?

elif user_input == "add": num1 = float(input("Enter a number: ")) num2 = float(input("Enter another number: ")) result = str(num1 + num2) print("The answer is " + result)

23rd Feb 2019, 11:06 AM
Dee Pan Kar
Dee Pan Kar - avatar
2 ответов
+ 5
str-string.. On line four your getting num1+num2,converting it into a string then assigning it to result..
23rd Feb 2019, 11:14 AM
Mensch
Mensch - avatar
0
why can we directly assign float valve to result ??
24th Feb 2019, 9:20 AM
Dee Pan Kar
Dee Pan Kar - avatar