-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules_main.py
More file actions
23 lines (19 loc) · 900 Bytes
/
Copy pathmodules_main.py
File metadata and controls
23 lines (19 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ==========================================
# Python Learning Lab: 06 Modules (Main)
# ==========================================
# Instructions:
# Import the custom module `math_operations` and use it to solve the math challenges.
# TODO: Import functions add, subtract, multiply, and divide from math_operations.
# You can use: from math_operations import ...
from math_operations import add, subtract, multiply, divide
print("--- Running Modules Exercises ---")
def run_tests():
# TODO: Once imports are completed, uncomment the assertions below
assert add(5, 7) == 12, "Addition failed"
assert subtract(10, 4) == 6, "Subtraction failed"
assert multiply(3, 4) == 12, "Multiplication failed"
assert divide(8, 2) == 4.0, "Division failed"
print("✓ All math operations assertions passed!")
if __name__ == "__main__":
run_tests()
print("\n🎉 Run successful!")