STEP 16: Let's try a few more test cases and make sure the program is working as we want it to.

  • Our loop is not infinite! Delete this code from within the while loop: print("Infinite·loop!")
  • Click Run and enter the word error. What happens now when you guess r ?
  • Try out the effect of the while loop with some other words. Try words like mississippi, banana, or aardvark!
  • Look at the code now included in the while loop. How does it prevent the while loop from being infinite?

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)