-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsorting_hat.py
More file actions
69 lines (62 loc) · 2.23 KB
/
Copy pathsorting_hat.py
File metadata and controls
69 lines (62 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#################################################################
# The following program is an implementation of the Harry Potter#
# sorting hat. The user is asked to answer three different #
# questions and then is sorted to the revelant Hogwarts house #
# based on a score calculated according to the answers. #
# ###############################################################
answer_1 = int(input("Q1) Do you like Dawn or Dusk? \n 1) Dawn \n 2) Dusk \n"))
answer_2 = int(input("Q2) When I'm dead, I want people to remember me as: \n 1) The Good \n 2) The Great \n 3) The Wise \n 4) The Bold \n"))
answer_3 = int(input("Q3) Which kind of instrument most pleases your ear? \n 1) The violin \n 2) The trumpet \n 3) The piano \n 4) The drum \n "))
gryffindor = 0
slytherin = 0
ravenclaw = 0
hufflepuff = 0
if answer_1 == 1:
gryffindor = gryffindor + 1
ravenclaw = ravenclaw + 1
elif answer_1 == 2:
slytherin = slytherin + 1
hufflepuff = hufflepuff + 1
else:
print("Wrong input.")
if answer_2 == 1:
hufflepuff = hufflepuff + 2
elif answer_2 == 2:
slytherin = slytherin + 2
elif answer_2 == 3:
ravenclaw = ravenclaw + 2
elif answer_2 == 4:
gryffindor = gryffindor + 2
else:
print("Wrong input.")
if answer_3 == 1:
slytherin = slytherin + 4
elif answer_3 == 2:
hufflepuff = hufflepuff + 4
elif answer_3 == 3:
ravenclaw = ravenclaw + 4
elif answer_3 == 4:
gryffindor = gryffindor + 4
else:
print("Wrong input.")
print(f"Total points per house \n gr: {gryffindor}, rav: {ravenclaw}, sl: {slytherin}, huff: {hufflepuff}")
if gryffindor > slytherin and hufflepuff > ravenclaw:
if gryffindor > hufflepuff:
print("You are a gryffindor! 🦁")
else:
print("You are a hufflepuff! 🦡")
elif gryffindor > slytherin and ravenclaw > hufflepuff:
if gryffindor > ravenclaw:
print("You are a gryffindor! 🦁")
else:
print("You are a ravenclaw! 🦅")
elif slytherin > gryffindor and hufflepuff > ravenclaw:
if slytherin > hufflepuff:
print("You are a slytherin! 🐍")
else:
print("You are a hufflepuff! 🦡")
else:
if slytherin > ravenclaw:
print("You are a slytherin! 🐍")
else:
print("You are a ravenclaw! 🦅")