Python Python Basics (2015) Letter Game App Exiting

Justin Lee
PRO
Justin Lee
Pro Student 593 Points

Exiting question, what's wrong with my code?

seems to have an issue exiting. Not sure what's wrong.

firedoor.py
import sys

while True:
    ask = input("Do you want to start the movie?")
    if ask.lower() != "n":
        print("Enjoy the show!"):
            sys.exit()
    else:
        sys.exit()
Anthony Box
Anthony Box
7,435 Points

Looks like you placed a colon at the end of your print statement. Also unindent the first sys.exit (syntax)!

2 Answers

karson Adam
karson Adam
31,957 Points

you have syntax error in print line ( unexpected colon ), and indentation error on first exit instruction. the correct code should be:

import sys

while True:
    ask = input("Do you want to start the movie?")
    if ask.lower() != "n":
        print("Enjoy the show!")
        sys.exit()
    else:
        sys.exit() 
Justin Lee
Justin Lee
Pro Student 593 Points

tried it. system show: Bummer! Exception: EOF when reading a line

karson Adam
karson Adam
31,957 Points

for this chalenge do not use loop, try this:

import sys

ask = input("Do you want to start the movie?")
if ask.lower() != "n":
    print("Enjoy the show!")
    sys.exit()
else:
    sys.exit()