Activity 2.27
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 == "E3":
example3()
elif choice == "P1":
problem1()
elif choice == "P2":
problem2()
elif choice == "P3":
problem3()
elif choice == "P4":
problem4()
elif choice == "P5":
problem5()
elif choice == "P6":
problem6()
elif choice == "P7":
problem7()
elif choice == "P8":
problem8()
elif choice == "P9":
problem9()
elif choice == "P10":
problem10()
elif choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid choice")
# example1 function definition
def example1():
print("Example 1")
# create a tuple with one element
# print the first element
# example2 function definition
def example2():
print("Example 2")
# create a tuple
# loop through elements v1
# loop through elements v2
# example3 function definition
def example3():
print("Example 3")
# create a tuple
# Convert tuple to list
# Modify the list
# Convert back to tuple
# problem1
def problem1():
pass # remove
# problem2
def problem2():
pass # remove
# problem3
def problem3():
pass # remove
# problem4
def problem4():
pass # remove
# problem5
def problem5():
pass # remove
# problem6
def problem6():
pass # remove
# problem7
def problem7():
pass # remove
# problem8
def problem8():
pass # remove
# problem9
def problem9():
pass # remove
# problem10
def problem10():
pass # remove
# call the main function, do not delete!
main()
Last updated