I cannot proceed further. Please help


#1

In the first topic of ‘Conditionals and Work Flow’, I was asked to just run the pre-written program, but there is some bug or something. I changed nothing in the pre-written code, still getting some unknown error.
I cannot proceed further until it is resolved, so please help, if you can spot something in my desktop’s screenshot.

I am also pasting the same code below for an easy viewing experience.

def clinic():
    print "You've just entered the clinic!"
    print "Do you take the door on the left or the right?"
    answer = raw_input("Type left or right and hit 'Enter'.").lower()
    if answer == "left" or answer == "l":
      print "This is the Verbal Abuse Room, you heap of parrot droppings!"
    elif answer == "right" or answer == "r":
      print "Of course this is the Argument Room, I've told you that already!"
    else:
      print "You didn't pick left or right! Try again."
      clinic()

clinic()

Thanks


#2

You have to type left (or right) before hitting enter, you actually need to fill in the prompt (raw_input is prompting for input). This has to be done while programming is running (after pressing run button)


#3

Thanks, I got it :blush:


#4

The Input is nothing but some value from a user. remember If the input() or raw_input() function is called, the program flow will be stopped until the user has given an input and has ended the input with the return key, so we need to give some input. Also, you are calling a method in else block if the input doesn’t match with your condition. you need to give a correct input.

External Link - Get user input in python


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.