Why use int ("2") + int ("3") when we can directly write print (2+3)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why use int ("2") + int ("3") when we can directly write print (2+3)?

1st Mar 2018, 10:46 AM
Deepak Kumar
Deepak Kumar - avatar
3 Answers
+ 15
because user can input only string in some languages
1st Mar 2018, 10:48 AM
Vukan
Vukan - avatar
+ 3
because when user enter the data, it is automatically stored as a string data type. we need to convert that to the required datatype to perform operations on it. i think you may have understood.
1st Mar 2018, 10:55 AM
Paavan Gupta
Paavan Gupta - avatar
+ 1
ok
1st Mar 2018, 10:48 AM
Deepak Kumar
Deepak Kumar - avatar