Activity 2.4
Source Code
def main():
done = False
while not done:
print("Menu System")
print("E1 - Example 1")
print("Q - Quit")
choice = input("Choice: ")
if choice == "E1":
example1()
elif choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid choice")
# example1 function definition
def example1():
print("Example 1")
# create a dictionary named d
# use a loop to print the key/value pairs
# number of elements
# call the main function, do not delete!
main()
Last updated