How does int('3' + '4') become 34? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How does int('3' + '4') become 34?

Wouldn't it be like a math equation converting the 3 and the 4 to an integer so it would become 7?

7th Nov 2018, 9:13 AM
Samir Mahmoud
2 Answers
+ 4
inside of parentheses 2 strings, so “3”+”4” becomes “34”, after that Int type cast and we get 34 from “34”
7th Nov 2018, 9:17 AM
Sokrat_Poghosyan
Sokrat_Poghosyan - avatar
+ 1
NIk01 Thanks :D
7th Nov 2018, 9:23 AM
Samir Mahmoud