Skip to content

PreethiS05/Sorting-hat-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Sorting-hat-

sorting_hat.py

Initialize house scores

gryffindor = 0 ravenclaw = 0 hufflepuff = 0 slytherin = 0

Question 1

print("Q1) Do you like Dawn or Dusk?") print(" 1) Dawn") print(" 2) Dusk")

answer1 = int(input("Enter your choice (1 or 2): "))

if answer1 == 1: gryffindor += 1 ravenclaw += 1 elif answer1 == 2: hufflepuff += 1 slytherin += 1 else: print("Wrong input.")

Question 2

print("\nQ2) When I’m dead, I want people to remember me as:") print(" 1) The Good") print(" 2) The Great") print(" 3) The Wise") print(" 4) The Bold")

answer2 = int(input("Enter your choice (1 to 4): "))

if answer2 == 1: hufflepuff += 2 elif answer2 == 2: slytherin += 2 elif answer2 == 3: ravenclaw += 2 elif answer2 == 4: gryffindor += 2 else: print("Wrong input.")

Question 3

print("\nQ3) Which kind of instrument most pleases your ear?") print(" 1) The violin") print(" 2) The trumpet") print(" 3) The piano") print(" 4) The drum")

answer3 = int(input("Enter your choice (1 to 4): "))

if answer3 == 1: slytherin += 4 elif answer3 == 2: hufflepuff += 4 elif answer3 == 3: ravenclaw += 4 elif answer3 == 4: gryffindor += 4 else: print("Wrong input.")

Final Scores

print("\n--- House Scores ---") print("Gryffindor:", gryffindor) print("Ravenclaw:", ravenclaw) print("Hufflepuff:", hufflepuff) print("Slytherin:", slytherin)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors