Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This could form part of a game
- def transitions(place):
- place = place.lower()
- if place == "rooftop": return ("diningroom")
- elif place == "diningroom": return ("hallway", "rooftop")
- elif place == "bedroom": return ("hallway")
- elif place == "hallway": return ("diningroom", "bedroom")
- else: return ("Place Error, please try again")
- def main():
- place = ""
- while place.lower() != "x":
- if place == "":
- place = input("Where are you? (Enter \"X\" to exit) : ")
- else:
- place = input("Where do you want to go? (Enter \"X\" to exit) : ")
- if place == "x":
- print ("Bye for now!")
- else:
- print ("You can go to ... " + str (transitions (place)))
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement