0
Care to explain?
Even if your strings contain numbers, they are still added as strings rather than integers. Adding a string to a number produces an error, as even though they might look similar, they are two different entities. Source - python 3 tutorial > basic concepts > concatenation
6 Respuestas
+ 2
2 + e == 2e this is error
"2" + "2" == 22 this is string
2 + 2 == 4 this is integer sum
so integer + string gives error
string + string makes a new string like StringString
also keep in mind that every string is an array of letters.
"Word" is ["W","o","r","d"]
but integer is not array
234 is not [2,3,4]
+ 1
Is "2" + "e" possible?
+ 1
Melih Melik Sonmez Thank you
+ 1
Titus Mathew "2" + "e" will result as "2e" as they are concatenated as strings
+ 1
Thomas Williams I figured that out but thanks man 👌
0
you are welcome