Skip to content

Commit 422e615

Browse files
authored
Update 16_sorting_hat_1.py
1 parent 1cd70b8 commit 422e615

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

3-control-flow/16_sorting_hat_1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@
7777
print("Hufflepuff: ", hufflepuff)
7878
print("Slytherin: ", slytherin)
7979

80-
most_points = max(gryffindor, ravenclaw, hufflepuff, slytherin) # We'll learn about max() in the Functions chapter
80+
# Bonus Part
8181

82-
if gryffindor == most_points:
82+
if gryffindor >= ravenclaw and gryffindor >= hufflepuff and gryffindor >= slytherin:
8383
print('🦁 Gryffindor!')
84-
elif ravenclaw == most_points:
84+
elif ravenclaw >= hufflepuff and ravenclaw >= slytherin:
8585
print('🦅 Ravenclaw!')
86-
elif hufflepuff == most_points:
86+
elif hufflepuff >= slytherin:
8787
print('🦡 Hufflepuff!')
8888
else:
8989
print('🐍 Slytherin!')

0 commit comments

Comments
 (0)