summaryrefslogtreecommitdiff
path: root/projects/2/prog1.py
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-01-10 15:12:25 -0700
committermo khan <mo@mokhan.ca>2025-01-10 15:12:25 -0700
commite3f674733c56624fa9b8ce48fbb2bbba3fb166b1 (patch)
tree5299b40dbc9a09f518013cad55dc5e696834f57a /projects/2/prog1.py
parent41022a0f1bcd7c305915aba1a95aac5e7d8abff4 (diff)
Complete program 1 for project 2
Diffstat (limited to 'projects/2/prog1.py')
-rwxr-xr-x[-rw-r--r--]projects/2/prog1.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/projects/2/prog1.py b/projects/2/prog1.py
index e69de29..28e03f2 100644..100755
--- a/projects/2/prog1.py
+++ b/projects/2/prog1.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+print("""
+Program author: mo khan
+ID: 3431709
+Program 1 - Math Functions
+""")
+
+# Add two numbers and print the result
+print('ADDITION: 2+2={}'.format(2+2))
+
+# Subject one number from another and print the result
+print('SUBTRACTION: 4-2={}'.format(4-2))
+
+# Multiple two numbers and print the result
+print('MULTIPLICATION: 4*2={}'.format(4*2))
+
+# Divide one number from another and print the result
+print('DIVISION: 4/2={}'.format(4/2))
+
+# Compute the exponent and print the result
+print('EXPONENT: 2**3={}'.format(2**3))
+
+# Compute the remainder using modulus division and print the result
+print('REMAINDER: 5%2={}'.format(5%2))