+ 1
Why value of "x" will be 70 ?
>>> x="7" >>> x=x+"0" >>> print(x) 70
2 ответов
+ 8
Literals within quotes are string literals. The addition operator performs concatenation on strings. In this case, "7" is concatenated with "0" and assigned to x. Printing x will result in "70" being printed.
+ 8
Here
x = "7"
7 is string in this syntax
x=x+"0"
Here x is string which value is 7 and 0 also string.
When we add the string 7 and 0
Output will be 70.