- 3
Why is it that when I do ('2' + '2') it gives me 22
6 ответов
+ 4
Because using quotation marks means you're dealing with strings, not numbers.
+ 3
Concatenation
Python for Beginners
Tutorial 11.1
+ 1
At least this isn't happening in C or C++
0
Just add
0
Share your code
0
David,
It's because of the quotation marks, they imply that you're working with strings and not numbers.
To get the correct answer, get rid of the quotations