Activity 2.25
Source Code
import math
import random
def main():
done = False
while not done:
print("Menu System")
print("E1 - Example 1")
print("Q - Quit")
choice = input("Choice: ").upper()
if choice == "E1":
example1()
elif choice == "E2":
example2()
elif choice == "P1":
problem1()
elif choice == "P2":
problem2()
elif choice == "P3":
problem3()
elif choice == "P4":
problem4()
elif choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid choice")
# example1 function definition
def example1():
print("Example 1")
# create a dictionary named d
# print the value associated with name
# use a loop to print the key/value pairs
# number of elements
def example2():
print("Example 2")
# create an empty dictionary
# add a key/value pair
# print the value of the dictionary
# add another key/value pair
# search for a key
# problem1
def problem1():
pass
# problem2
def problem2():
pass
# problem3
def problem3():
pass
# problem4
def problem4():
pass
# call the main function, do not delete!
main()
Last updated