QuestionQ18

Python Basics

What is the output of the following program when it is run with the Python interpreter?

Question Image

  • A SyntaxError: invalid syntax
  • B 25
  • C 20
  • D 15
Explanation

The variable a starts at 10, is increased to 15 by a = a + 5, and is increased by another 5 by a += 5, so print(a) outputs 20.

Community Discussion

No comments yet. Be the first to start the discussion!