Upgrade to Pro — share decks privately, control downloads, hide ads and more …

while.pdf

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 while.pdf

simple while

Avatar for Jussi Pohjolainen

Jussi Pohjolainen

April 14, 2020
Tweet

More Decks by Jussi Pohjolainen

Other Decks in Technology

Transcript

  1. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py
  2. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 < 3 → True
  3. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 print(0)
  4. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 i = 0 + 1 → i = 1
  5. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 < 3 → True
  6. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 print(1)
  7. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 i = 1 + 1 → i = 2
  8. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 2 < 3 → True
  9. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 2 print(2)
  10. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 2 i = 2 + 1 → i = 3
  11. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 2 3 < 3 → False
  12. i = 0 while i < 3: print(i) i =

    i + 1 > python code.py 0 1 2