Activity 2.24
Source Code
import random
def main():
# items list
items = ["sword", "scissors"]
done = False
while not done:
print("Menu System")
print("E1 - Example 1")
print("Q - Quit")
choice = input("Choice: ")
if choice == "E1":
# example1 function call
example1(items)
elif choice == "E2":
# print items
print(items)
elif choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid choice")
# example1 function definition
def example1(items):
print("Example 1")
# call the main function, do not delete!
main()
Last updated