KnowledgeBoat Logo

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

  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.

Answered By

20 Likes


Related Questions