CBSE Class 11 Informatics Practices Question 82 of 102

Python Programming Fundamentals — Question 43

Back to all questions
43
Question

Question 30

Give the output.

a, b, c = 10, 20, 30
p, q, r = c - 5, a + 3, b - 4
print(p, q, r)
Answer
Output
25 13 16
Explanation

In the given code, using multiple assignment, three variables a, b, and c are initially assigned values 10, 20, and 30 respectively and variables p, q, and r are assigned new values: p is assigned c - 5 (resulting in 25), q is assigned a + 3 (resulting in 13), and r is assigned b - 4 (resulting in 16). When print(p, q, r) is executed, it outputs 25 13 16, representing the values after the assignments.