Vidyalelo
Python · Q46

Python Loops and Conditionals: MCQs for Exam Readiness

Programming · Python · question 46

Q46

What will be the output of the following Python code snippet? x = 2 for i in range(x): x += 1 print (x)

A.
0 1 2 3 4 ...
B.
0 1
C.
3 4
Answer
D.
0 1 2 3

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board