Multiple houses
Closed this issue ยท 1 comments
Kodoka commented
As designed, choosing options such as: 1, 3, 4 on each question respectively, would result in both Gryffindor and Ravenclaw having the same weight in determining one's house. Maybe swap the last bit, that evaluates the winning house, to something like...
if(ravenclaw > gryffindor and ravenclaw > slytherin and ravenclaw > hufflepuff):
print("Ravenclaw!")
elif(gryffindor > ravenclaw and gryffindor > slytherin and gryffindor > hufflepuff):
print("Gryffindor!")
elif(slytherin > ravenclaw and slytherin > gryffindor and slytherin > hufflepuff):
print("Slytherin!")
elif(hufflepuff > ravenclaw and hufflepuff > gryffindor and hufflepuff > slytherin):
print("Hufflepuff!")
else:
print("Multiple houses.")
Granted your code will still spit out one winner, but I feel like it could be confusing to some as to why Gryffindor is taking priority over Ravenclaw, when they have the same amount of points. Especially since Ravenclaw should win. ๐
ACRU-BEAST commented
This is overkill but precise.
if Gryffindor == Hufflepuff == Slytherin == Ravenclaw:
print("It's a tie! choose between: ๐ฆ Gryffindor, ๐ฆ
Ravenclaw, ๐ Slytherin & ๐ฆก Hufflepuff")
elif Gryffindor > Hufflepuff:
if Gryffindor > Slytherin:
if Gryffindor == Ravenclaw:
print("It's a tie! choose between: ๐ฆ Gryffindor & ๐ฆ
Ravenclaw")
elif Gryffindor > Ravenclaw:
print("Your house is: ๐ฆ Gryffindor!")
else:
print("Your house is: ๐ฆ
Ravenclaw!")
elif Slytherin > Ravenclaw:
print("Your house is: ๐ Slytherin!")
else:
print("Your house is: ๐ฆ
Ravenclaw!")
elif Hufflepuff > Ravenclaw:
if Hufflepuff == Slytherin:
print("It's a tie! choose between: ๐ฆก Hufflepuff & ๐ Slytherin")
elif Hufflepuff > Slytherin:
print("Your house is: ๐ฆก Hufflepuff!")
else:
print("Your house is: ๐ Slytherin!")
elif Ravenclaw > Slytherin:
print ("Your house is: ๐ฆ
Ravenclaw!")
else:
print("Your house is: ๐ Slytherin!")