Back to Freecodecamp

Loops and Iterations

curriculum/challenges/english/blocks/python-for-everybody/5e7b9f060b6c005b0e76f05c.md

latest288 B
Original Source

--questions--

--text--

What will the following code print out?:

python
n = 0
while True:
    if n == 3:
        break
    print(n)
    n = n + 1

--answers--

<pre>0 1 2</pre>
<pre>0 1 2 3</pre>
<pre>1 2</pre>
<pre>1 2 3</pre>

--video-solution--

1