Interactive Stories with Input

You can use if statements to make a story interactive where the reader picks from several possible next actions. The input method will display the string and return what the user types. You can check if two strings have the same characters using == in Python.

Before you keep reading...

Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.

What should the program do if the user enters something besides in, left, or right? Fix the code above to let the user know what went wrong. Also add another possibility like “out”.

You have attempted 1 of 4 activities on this page