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)
2 Respostas
+ 5
str-string.. On line four your getting num1+num2,converting it into a string then assigning it to result..
0
why can we directly assign float valve to result ??