0

print(int(input("Enter a number: ")) + int(input("Enter another number: "))).. this code is giving error why?

same code is given with the data type float at both places (where i had written int) and this code is giving a valid output

11th Aug 2017, 4:30 PM
Isha
2 Réponses
+ 1
int() only converts a string which contains an integer not a float, probably that should result in your ValueError
11th Aug 2017, 4:43 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
0
can u please elaborate it. i didn't got it
11th Aug 2017, 4:45 PM
Isha