Skip to content

Instantly share code, notes, and snippets.

@bensk
Created April 1, 2016 01:19
Show Gist options
  • Select an option

  • Save bensk/ec957b3de5bedbb1cb59ff7eea44ec78 to your computer and use it in GitHub Desktop.

Select an option

Save bensk/ec957b3de5bedbb1cb59ff7eea44ec78 to your computer and use it in GitHub Desktop.
Debugging While Loops.py
# For each example below, predict what will be printed. Then, run the code and confirm your prediction.
a = 0
while a< 100:
print a
"""
Prediction:
Observation:
"""
a = 0
while a < 100:
a = a + 1
print a
"""
Prediction:
Observation:
"""
a = raw_input("Would you like to quit: ")
while a != "y":
a = raw_input("Would you like to quit: ")
"""
Prediction:
Observation:
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment