-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestingsortinghat.py
74 lines (62 loc) · 1.38 KB
/
testingsortinghat.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
# Initialize house points
gryffindor = 0
ravenclaw = 0
hufflepuff = 0
slytherin = 0
# Question 1
print('Q1) Question 1: Do you like Dawn or Dusk?')
print(' 1) Dawn')
print(' 2) Dusk')
answer = int(input())
if answer == 1:
gryffindor += 1
ravenclaw += 1
elif answer == 2:
hufflepuff += 1
slytherin += 1
else:
print('Wrong input.')
# Question 2
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')
answer = int(input())
if answer == 1:
hufflepuff += 2
elif answer == 2:
slytherin += 2
elif answer == 3:
ravenclaw += 2
elif answer == 4:
gryffindow += 2
else:
print('Wrong input.')
# Question 3
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')
answer = int(input())
if answer == 1:
slytherin += 4
elif answer == 2:
hufflepuff += 4
elif answer == 3:
ravenclaw += 4
elif answer == 4:
gryffindor += 4
else:
print('Wrong input.')
# Determine the house with the most points
max_points = max(gryffindor, ravenclaw, hufflepuff, slytherin)
if gryffindor == max_points:
print('Gryffindor!')
if ravenclaw == max_points:
print('Ravenclaw!')
if hufflepuff == max_points:
print('Hufflepuff!')
if slytherin == max_points:
print('Slytherin!')