CBSE Class 11 Computer Science Question 77 of 98

Python Programming Fundamentals — Question 39

Back to all questions
39
Question

Question 26

Give the output.

a, b = 12, 13
c, b = a * 2, a/2
print(a, b, c)
Answer
Output
12 6.0 24
Explanation
  1. a, b = 12, 13 ⇒ assigns an initial value of 12 to a and 13 to b.
  2. 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.
  3. print (a, b, c) ⇒ prints the value of a, b, c as 12, 6.0 and 24 respectively.