- 2
On question 3/5
howwww, I am bad with the math things, please help
2 Antworten
+ 1
x = 5
y = x + 3
print(str(y)+"2")
so y = 8 (5 + 3) but when it prints y it first converts it to a string type (hence the str(y) part)...
python will "add" two strings together by connecting them. "a" + "b" = "ab" just like "1" + "1" = "11".
the answer is 82 because it takes the string version of y (8) and connects the string "2" to the end of it, giving us a string of "82".
0
why is it 82? will someone explain how the math goes down and what the commands mean