-
Notifications
You must be signed in to change notification settings - Fork 0
/
cms_sorting_hat.py
24 lines (19 loc) · 1004 Bytes
/
cms_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
import random
import time
# Each list contains values. The first list contains the sorting hat phrases and the second list contains Hogwarts Houses
phrases = ["hmmmmmm", "Difficult. Very difficult!", "Where shall I put you?", "Are you sure you're not a muggle? Well then!", "You need to wash your hair!", "You might go Ravenclaw!", "Maybe Slytherin?", "Maybe. Just Maybe."]
house = ["SLYTHERIN!", "HUFFLEPUFF!", "GRYFFINDOR!", "RAVENCLAW!"]
# This loop selects two random numbers
for x in range(1):
random_phrase = (random.randint(0,7))
random_house = (random.randint(0,3))
# This input field asks the user what their name is
print("I am the Sorting Hat and I will sort you into your Hogwarts house. \n")
name = input("Come close child. What is your name? \n")
# Generates random phrases and tells the user what house they belong to
print("\n")
print("Hello", name.capitalize(),"!")
time.sleep(2)
print(phrases[int(random_phrase)])
time.sleep(2)
print("You belong in", house[int(random_house)])