Exam GPYC All QuestionsBrowse all questions from this exam
Question 13

What it the output of the following program when executed with the Python Interpreter?

    Correct Answer: C

    The initial value of a is 10. The first operation a = a + 5 increases the value of a by 5, making it 15. The second operation a += 5 further increases the value of a by 5, making it 20. Therefore, the output of the program is 20.

Discussion
cliwanagOption: C

a = 10 a = a + 5 -> a = 10 + 5 = 15 a += 5 -> a = 15 + 5 = 20

AZIrvThoOption: D

When running this code: a = 10 a += 5 print (a) The answer returned is 15.