-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsorting-hat.py
82 lines (71 loc) · 2.03 KB
/
sorting-hat.py
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
70
71
72
73
74
75
76
77
78
79
80
81
82
# Write code below 💖
print ('Welcome to the sorting hat quiz')
print ('---------------------------')
print ('provide the corresponding number as rsponse to the following questions to find your hogwarts house')
print ('----------------------------')
gryffindor = 0
ravenclaw = 0
hufflepuff = 0
slytherin = 0
print ('Q1) Do you like Dawn or Dusk?')
print (' 1) Dawn')
print (' 2) Dusk')
ques1 = int( input ('Answer: ') )
if ( ques1 == 1):
gryffindor += 1
ravenclaw += 1
print ('response recorded!')
elif ( ques1 == 2):
hufflepuff += 1
slytherin += 1
print ('response recorded!')
else:
print ('Wrong input')
print ('------------------------------')
print ('Q2) 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 ')
ques2 = int( input ('Answer: ') )
if (ques2 == 1):
hufflepuff += 2
print ('response recorded!')
elif (ques2 == 2):
slytherin += 2
print ('response recorded!')
elif (ques2 == 3):
ravenclaw += 2
print ('response recorded!')
elif (ques2 == 4):
gryffindor += 2
print ('response recorded!')
else:
print ('Wrong input')
print ('------------------------------')
print (' Q3) Which kind of instrument most pleases your ear? ')
print (' 1) The violin ')
print (' 2) The trumpet ')
print (' 3) The piano ')
print (' 4) The drum ')
ques3 = int( input ('Answer: ') )
if (ques3 == 1):
slytherin += 4
print ('response recorded!')
elif (ques3 == 2):
hufflepuff += 4
print ('response recorded!')
elif (ques3 == 3):
ravenclaw += 4
print ('response recorded!')
elif (ques3 == 4):
gryffindor += 4
print ('response recorded!')
else:
print ('Wrong input')
print ('------------------------------')
print (' Congratulations, you have finished the quiz! ')
# Determine the house based on the highest score
houses = {'Gryffindor': gryffindor, 'Hufflepuff': hufflepuff, 'Ravenclaw': ravenclaw, 'Slytherin': slytherin}
max_house = max(houses, key=houses.get)
print('Your Hogwarts house is:', max_house)