keyboard_arrow_left keyboard_arrow_right
Nived's Project

Harry Potter Quiz

About Nived

I am Nived Nair and my dream is to become a digital content creator for mostly Video games and videos, which is why I enrolled in givemefive to learn coding ( An essential part of achieving my dream career). I like spending my time playing Video Games. Because of my love for video games I also created a youtube channel to post videos of me playing Games.

Nived's project details:

I also love reading books and I have read one of the most famous fiction Novels, Harry Potter and absolutely loved reading the series. I am a harry potter fan which gave me the idea of making a Sorting Hat quiz which determines which house you go into. The four houses are Griffindor, Ravenclaw, Slytherin and Hufflepuff. The answer you give to the questions given will determine which you will be sorted into.

print("*****************The Sorting Hat's quiz*******************\n")
print("This quiz will determine in which house you belong to at the magical school of hogwarts\n")

print("We will begin the sorting ceremony with one of our many traditions the sorting hat's song!!\n")
print("""Oh you may not think I'm pretty,
But don't judge on what you see,
I'll eat myself if you can find
A smarter hat than me.

You can keep your bowlers black,
Your top hats sleek and tall,
For I'm the Hogwarts Sorting Hat
And I can cap them all.

There's nothing hidden in your head
The Sorting Hat can't see,
So try me on and I will tell you
Where you ought to be.

You might belong in Gryffindor,
Where dwell the brave at heart,
Their daring, nerve, and chivalry
Set Gryffindors apart;

You might belong in Hufflepuff,
Where they are just and loyal,
Those patient Hufflepuffs are true
And unafraid of toil;

Or yet in wise old Ravenclaw,
if you've a ready mind,
Where those of wit and learning,
Will always find their kind;

Or perhaps in Slytherin
You'll make your real friends,
Those cunning folks use any means
To achieve their ends.

So put me on! Don't be afraid!
And don't get in a flap!
You're in safe hands (though I have none)
For I'm a Thinking Cap!""")

print ("Now for the sorting you will be asked 10 questions by the Sorting Hat testing your personality and the answers you give will determine which house is best suiting you.\n")
print("You will be asked 10 questions with options for each question, Each option has a certain amount of points assigned to it.\n")
print("At the end of the quiz enter your points to figure out the best suiting house for you\n ")


print("Q1. Which of the following pair of Subjects would you like the most at Hogwarts?")
print("Answer options: \na.Charms and Defence against Dark Arts \nb.Potions and Transfiguration \nc.Flying/Quidditch lessons and Charms")
ans1=input("Enter your answer using the letters for the options a,b or c >")
(" ")
(" ")
(" ")
(" ")
(" ")
(" ")
if ans1=='a':

if ans1=='b':

if ans1=='c':


print("Q2. Which of the following pets would you bring to Hogwarts?")
print("Answer options : \na.Cat \nb.Owl \nc.Toad")
ans2=input("Enter your answer to the question using a,b or c")

if ans2=='a':

if ans2=='b':
if ans2=='c':
print("Q3. Which Deathly hallow would you want to have the most ?")
print("Answer options : \na.Elder Wand  \nb.Ressuruction Stone \nc.Invisibility Cloak")
ans3=input("Enter your answer to the question using a,b or c")

if ans3=='a':
if ans3=='b':

if ans3=='c':
print("Q4.What word would you find most hurting ?")
print("Answer options : \na.Weak  \nb.Coward  \n.Evil")
ans4=input("Enter your answer to the question using a,b or c")

if ans4=='a':
if ans4=='b':

if ans4=='c':
print("Q5.Someone is going to fire a spell you dont know about, what spell would you cast ?")
print("Answer options : \na.Expelliarmus  \nb.Protego  \nc.An Unforgivable Curse")
ans5=input("Enter your answer to the question using a,b or c")

if ans5=='a':
if ans5=='b':

if ans5=='c':
print("Q6.What would be your signature move ?")
print("Answer options : \na.Expelliarmus  \nb.Stupefy  \nc.Reducto")
ans6=input("Enter your answer to the question using a,b or c")

if ans6=='a':
if ans6=='b':

if ans6=='c':
print("Q6.What is would be your favourite your favourite spirit animal (Patronus) ?")
print("Answer options : \na.Stag  \nb.Phoenix  \nc.Hare")
ans7=input("Enter your answer to the question using a,b or c")

if ans7=='a':
if ans7=='b':

if ans7=='c':
print("Q7.What job would you take up after hogwarts ?")
print("Answer options : \na.Lawyer  \nb.Auror  \nc.Teacher")
ans8=input("Enter your answer to the question using a,b or c")

if ans8=='a':
if ans8=='b':

if ans8=='c':
print("Q8.What do you think about your Personality ?")
print("Answer options : \na.Smart  \nb.Funny  \nc.Brave \nd.Kind")
ans9=input("Enter your answer to the question using a,b or c")

if ans9=='a':
if ans9=='b':

if ans9=='c':

if ans9=='d':
print("Q10. What Hogwarts house do you want to be in ?")
print("Answer options : \na.Griffindor  \nb.Ravenclaw  \nc.Slytherin \nd.Hufflepuff")
ans10=input("Enter your answer to the question using a,b or c")

if ans10=='a':
if ans10=='b':

if ans10=='c':

if ans10=='d':

print("You scored",score,"points")

if score>=100 and score< 200:
    print("Congratulations you are in Hufflepuff.")
    print("You are part of a group of people who are just, loyal, honest and patient")
if score>=200 and score< 300 :
    print ("Congratulation you are in Ravenclaw,")
    print("You are part of a group of people who are smart and logical")
if score>=300 and score< 400 :
    print("Congratulations you are in Griffindor")
    print("Your part of people who are brave and dare any task")
if score>=400 and score< 500:
    print("Congratulations you are in Slytherin")
    print("Your group of people are very cunning and would do anything to achieve their goal")
if score==100:
    print("You are either a squib that cannot perform magic or you are a person with a corrupted mind like Voldemort")
if score==500:
    print("You are either a muggle or a very kind person who would have most power in the world but not misuse it like Dumbledore or Harry Potter himself")

print("So we are done with the naming ceremony and hope you enjoy your future years at hogwarts")  


Name: Nived Nair
Grade: 8
Be the Next Creator like :