available_exits = ["north", "south", "east", "west"]

chosen_exit = ""
while chosen_exit not in available_exits:
        chosen_exit = input("Please choose a direction: ")
            if chosen_exit == "quit":
                        print("Game over")
                                break

                            print("aren't you glad you got out of there")

                            #A for loop will repeat for each item in a pre-determined sequence, whereas with a while loop you don't need to know how
                            #times the loop will execute
