CBSE Class 11 Computer Science
Question 50 of 80
Conditional and Looping Constructs — Question 20
Back to all questions27.2
num1 = 2 + 9 * ((3*12)-8)/10Let's calculate this step by step, following the precedence of operators in Python:
1. Evaluate the innermost parentheses first:
3 * 12 = 362. Replace and continue evaluating inside the parentheses:
((3*12)-8) => (36 - 8) = 283. Now, evaluate the multiplication and division:
9 * 28 = 2524. Continue with dividing by 10:
252 / 10 = 25.25. Finally, add 2:
2 + 25.2 = 27.2The print(num1) statement outputs 27.2