Post

@PythonPr If they were integers it would be 5 + 5 = 10, but they are not. a and b are both strings, so this is string concatenation and python joins them as text as 55.
English

@PythonPr Python said: concatenate first, calculate later 👀
English

@PythonPr the result would have been the integer 10.
Because they are enclosed in quotes, they are treated as strings.

English

@PythonPr Answer: 55
"5" is a string, so + joins it, doesn't add it.
Same trap as input(): everything comes back quoted.
For beginners: int() converts the string to a number.
int("5") + int("5") = 10. Without it, always concatenation.
English

@PythonPr 55. String concat. Watched juniors burn hours on this exact type trap.
English

@PythonPr Answer is 55
Because a&b are string,
Concatenation of a&b
Gives 55 that is also string
English


































