CBSE Class 11 Informatics Practices Question 81 of 102

Python Programming Fundamentals — Question 42

Back to all questions
42
Question

Question 29

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.