Advertisements
Advertisements
Question
Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
num1 += num2 + num3
print (num1)
Short/Brief Note
Advertisements
Solution
num1 += 3 + 2
The above statement can be written as
num1 = num1 + 3 + 2 = 4 + 3 + 2 = 9
Therefore, print(num1) will give the output 9.
shaalaa.com
Python Data Types
Is there an error in this question or solution?
