# Author: James Tam # Version: September 21, 2021 # Learning objectives: # 1) Using if-else with mutually exclusive conditions (only 0 or 1 can be true) # 2) Setting up text menu options that logically relate to the feature being # invoked. (Opposed to arbitrary 0 = add new player, 2 = remove player). # Note this program is not complete (it would beyond the scope of a 1st year # course to implement a full role playing game). print("""" GAME OPTIONS ------------ (a)dd a pre-generated player (c)reate new player (p)urge player entirely from game (gone forever) (r)emove existing player (player information is saved) (q)uit game """) menuSelection = input("Selection: ") if (menuSelection == "a"): print("Adding player.") elif (menuSelection == "c"): print("Creating new player.") elif (menuSelection == "p"): print("Caution: A purged player will be gone forever and not retrievable.") print("Are you sure you want to really do this?") elif (menuSelection == "r"): print("Removing player and saving current stats.") elif (menuSelection == "q"): print("Quiting game, thank you and come again.") #A big advantage of using an elif over multiple IFs else: print("Selection must be one of 'a', 'c', 'p', 'r', 'q'")