Quiz problems


SOMEBODY HELP ME ! I've been trying to make a quiz but i'm stuck , i can't find the problem from my codes . Can somebody please help ?

This is the code (Python 2 ) :

def Quiz_1() :
print "Who is president Obama ? "
print "A : a president who won 4 terms "
print "B : a president who won 2 terms "
Quiz_1_answer = raw_input("Choose "A" or "B", please ").lower()
| if Quiz_1_answer == "a" :
|| print "You are correct !"
| elif Quiz_1_answer == "b" :
|| print "You are incorrect !"
| else :
|| print "I am sorry , my brain isn't capable of understanding what you said , try again"
|| Quiz_1
print raw_input("Thanks for playing !")

Please help me !


raw_input is used to take input from keyboard, if you want to print something just use print, lower is function, you need to pass an argument to function, think you will need do while loop if you want to get back every time input is not a or b


Can you fix the code for me please ? I need better an example to understand ( i'm quite noob to computers :smile:) Thank you !


I need an example , PLEASEEEEEEEE ! I'm new


Which arguement ?
About the loop : This is the example code in codecademy lessons :

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()

I can't see the different from the example and my code !


Oh never mind , i saw the problem now :slight_smile: . Thanks man ! :smile: