# Ramnpreet's python test program # lesson1,2,3,4,5 and 7 print "Welcome to the hogwarts house quiz" gcounter=0 hcounter=0 rcounter=0 scounter=0 print"1=courage" print"2=patience" print"3=intelligence" print"4=ambition" question1=input("What do you value most?") print"5=Neville Longbottom" print"6=Nymphadora Tonks" print"7=Luna Lovegood" print"8=Tom Riddle" question2=input("Who are you most like?") if question2==8: print"you know Tom Riddle is voldemort's real name" print"9=white chocolate" print"10=all kind of chocolate" print"11=milk chocolate" print"12=dark chocolate" question3=input("what is your favourite chocolate?") print"13=lion" print"14=badger" print"15=eagle" print"16=serpent" question4=input("which animal do you like best?") print"17=transfiguration" print"18=herbology" print"19=charms" print"20=potions" question5=input("what is your favourite subject?") if question1==1: gcounter=gcounter+1 elif question2==5: gcounter=gcounter+1 elif question3==9: gcounter=gcounter+1 elif question4==13: gcounter=gcounter+1 elif question5==17: gcounter=gcounter+1 elif question1==2: hcounter=hcounter++ question2 and question3 and question4 and question5 elif question2==6: hcounter=hcounter++ question1 and question3 and question4 and question5 elif question3==10: hcounter=hcounter++ question1 and question2 and question4 and question5 elif question4==14: hcounter=hcounter++ question1 and question3 and question2 and question5 elif question5==18: hcounter=hcounter++ question1 and question3 and question4 and question2 elif question1==3: rcounter=rcounter++ question2 and question3 and question4 and question5 elif question2==7: rcounter=rcounter++ question1 and question3 and question4 and question5 elif question3==11: rcounter=rcounter++ question1 and question2 and question4 and question5 elif question4==15: rcounter=rcounter++ question1 and question3 and question2 and question5 elif question5==19: rcounter=rcounter++ question1 and question3 and question4 and question2 elif question1==4: sconter=scounter++ question2 and question3 and question4 and question5 elif question2==8: scounter=scounter++ question1 and question3 and question4 and question5 elif question3==12: scounter=scounter++ question1 and question2 and question4 and question5 elif question4==16: scounter=scounter++ question1 and question3 and question2 and question5 elif question5==20: scounter=scounter++ question1 and question3 and question4 and question2 counter = "sortinghatquiz" print counter counter = counter + 5 again = input("Do you want to try again? 1 for Yes, 2 for No ") raw_input("\n\nPress the Enter key to exit")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question