0
Explanation of this code, please
Can someone tell me why this python code outputs 5 A = 1#2 B = "5" AB = B*A print (AB) Thanks
5 ответов
+ 1
# use in python for write a comment for example
A=5*2 #the result is 10
the compiler execute just A=5*2 and leave everythings that comes after "#"
+ 3
A = 1#2
# ==> comment in python so A =1
B="5" ==> B its string variable
AB = B*A ==> "5"*1 that mean repeat "5" once times if was A = 3 the result equal 555
0
A = 1#2
# ==> comment in python so A =1
Can you elaborate please?
0
Thank you. haven't been taught about that just yet.
0
a=1 #2 comments
so
a=1
b='5'
ab=b*a
print (ab)
print (1×'5')
so and is '5'