import random

encounters = ["troll in the corridor", "friendly ghost", "lost first-year"]
event = random.choice(encounters)
print("You round the corner and see a", event + "!")

roll = random.randint(1, 6)   # random whole number from 1 to 6
if roll >= 4:
    print(f"You rolled {roll} — success!")
else:
    print(f"You rolled {roll} — hide behind a statue.")
