- 1
Stupis af
Can please someone explain whats behind this calculation? What is the output of this code? >>> x = 5 >>> y = x + 3 >>> y = int(str(y) + "2") >>> print(y) thx...
1 Respuesta
+ 2
X=5. >5
Y=X+3. >8 because 5 + 3 = 8
str(y) makes the y value a string so it's "8"
now "8"+"2" = "82" because it's a string + a string
int("8"+"2") makes the 82 an int
thus y = 82
print(y)
>>> 82