?
Categories
Account

What will be the output of the following code: 'for i in range(3): print(i)'?

  • 📥 Instant PDF Download
  • ♾ Lifetime Access
  • 🛡 Secure & Original Content

What’s inside this PDF?

Question: What will be the output of the following code: \'for i in range(3): print(i)\'?

Options:

  1. 0 1 2
  2. 1 2 3
  3. 0 1 2 3
  4. 3

Correct Answer: 0 1 2

Solution:

The loop iterates from 0 to 2, so the output will be \'0 1 2\'.

What will be the output of the following code: 'for i in range(3): print(i)'?

Practice Questions

Q1
What will be the output of the following code: 'for i in range(3): print(i)'?
  1. 0 1 2
  2. 1 2 3
  3. 0 1 2 3
  4. 3

Questions & Step-by-Step Solutions

What will be the output of the following code: 'for i in range(3): print(i)'?
No concepts available.
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely
Home Practice Performance eBooks