Unit 9
Source Code
print("Unit 9")
myName = "" # add your name
print("Name: " + myName)
def main():
done = False
print("Welcome to the Main Function")
print("Menu")
print("E1 - Example 1")
print("E2 - Example 2")
print("E3 - Example 3")
print("E4 - Example 4")
print("E5 - Example 5")
print("E6 - Example 6")
while not done:
choice = input("Choice: ")
match choice:
# case for Example 1
# case for Example 2
# case for Example 3
# case for Example 4
# case for Example 5
# case for Example 6
# case for Quit
case "Q":
print("Quitting!")
done = True
# default case
case _:
print("Invalid, try again!")
# define Example 1 Function
# define Example 2 Function
# define Example 3 Function
# define Example 4 Function
# define Example 5 Function
# define Example 6 Function
# call to main function, do not delete!
main()
grades.txt
87
92
76
54
89
65
73
81
50
98
67
88
74
79
62
91
45
68
86
94
sales.txt
105.47
250.32
489.78
320.15
768.52
198.43
540.89
623.25
710.34
890.96
134.58
578.63
620.74
430.29
315.80
912.50
830.21
550.06
790.99
267.45
512.87
692.48
359.02
925.64
773.38
658.92
482.06
246.79
699.31
345.23
temperatures.txt
72
74
78
80
77
73
75
82
84
79
76
74
78
81
83
80
79
76
77
82
83
81
75
74
78
80
82
79
77
75
Last updated