if 2+3 works and gives 5 ...why will somebody bother to use int"2"+int"3"?? can anybody tell real significance of int function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

if 2+3 works and gives 5 ...why will somebody bother to use int"2"+int"3"?? can anybody tell real significance of int function?

27th Aug 2016, 6:06 AM
Heisenberg
Heisenberg - avatar
2 Answers
+ 6
There was actually an example in the lesson. If you ask for numbers to add as an input, you will get them as strings. So you may want to turn them into integers or floats if you want to perform any actions with them.
27th Aug 2016, 8:23 AM
Doc
Doc - avatar
+ 1
they will work if you only want to show a digit. (since it will be just a string) but if you want to use that number in any function, you will have to use them as integer or float to work with them.
29th Aug 2016, 2:35 AM
Aditya Warade
Aditya Warade - avatar