+ 1
Anyone can explain this code?
import math x="a" x+=str(math.sqrt(25)) print(x) output: a5.0
3 Answers
+ 4
math.sqrt(25)= 5.0
#return type is float
x+=str(5.0)
print(a) - a5.0
+ 1
x is a string
math.sqrt(25) is a string
The + sign concatenates strings:
a = "as"
b = "tra"
c = a + b
c = "astra"
0
it says x is letter "a"
then it adds the square root of 25 into x so it becomes a5.0