ivantanchev

Sorting_hats

May 24th, 2022
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. name = input()
  2. if name == "Welcome!":
  3.     print("Welcome to Hogwarts.")
  4. while name != "Welcome!":
  5.     if name == "Voldemort":
  6.         print("You must not speak of that name!")
  7.         break
  8.     if len(name) < 5:
  9.         print(f"{name} goes to Gryffindor.")
  10.     elif len(name) == 5:
  11.         print(f"{name} goes to Slytherin.")
  12.     elif len(name) == 6:
  13.         print(f"{name} goes to Ravenclaw.")
  14.     else:
  15.         print(f"{name} goes to Hufflepuff.")
  16.     name = str(input())
  17.     if name == "Welcome!":
  18.         print("Welcome to Hogwarts.")
Advertisement
Add Comment
Please, Sign In to add comment