Computer Science
Predict the output:
a, b = 12, 13
c, b = a*2, a/2
print (a, b, c)
Python
Python Funda
34 Likes
Answer
Output
12 6.0 24
Explanation
a, b = 12, 13
⇒ assigns an initial value of 12 to a and 13 to b.c, b = a*2, a/2
⇒ c, b = 12*2, 12/2 ⇒ c, b = 24, 6.0. So c has a value of 24 and b has a value of 6.0.print (a, b, c)
⇒ prints the value of a, b, c as 12, 6.0 and 24 respectively.
Answered By
20 Likes
Related Questions
Predict the output:
x = 40 y = x + 1 x = 20, y + x print (x, y)
Predict the output:
x, y = 20, 60 y, x, y = x, y - 10, x + 10 print (x, y)
Predict the output:
a, b = 12, 13 print (print(a + b))
Predict the output
a, b, c = 10, 20, 30 p, q, r = c - 5, a + 3, b - 4 print ('a, b, c :', a, b, c, end = '') print ('p, q, r :', p, q, r)