# -*- coding: utf-8 -*- """ Created on Mon Oct 31 11:02:41 2022 @author: cpresser """ choices = ["Rock", "Paper", "Scissors"] #index = 0 #for item in choices: # print(f"{index}: {item}") # index += 1 #OR we could... done = False #I''m not done! #repeat this as long as I'm not done while not done: # done == False for idx in range(len(choices)): print(f"{idx}: {choices[idx]}") selectStr = input("Pick an item (0, 1, or 2): ") #catch the error, so it doesn't break our program #if an error occurs here, let me know instead of quitting try: #attempt to run this, but if something goes wrong, skip # to the except portion selectInt = int(selectStr) if 0 <= selectInt < len(choices): print(f"You chose {choices[selectInt]}.") done = True else: print(f"{selectInt} is not an option.") except: #if there is an error, the program will run this. print(f"{selectStr} is not a number") #if selectStr == "zero" or selectStr == "rock": # print("I got a rock.")