Vidyalelo
Python · Q39

Python MCQs: Variable Names and Operators Chapter

Programming · Python · question 39

Q39

What is the value of x after the following code: x = 5; x += 3; ?

A.
5
B.
8
Answer
C.
3
D.
15

Answer: Option B

Solution

Answer: Option B
Solution:
The += operator adds the right operand to the left operand and assigns the result to the left operand.