Stuff
This commit is contained in:
30
old/activity-core.py
Normal file
30
old/activity-core.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Created by Maxwell Jeffress, 11/02/2026
|
||||
# Does add, subtract, multiply, and divide operations on 2 numbers.
|
||||
|
||||
left = 0
|
||||
right = 0
|
||||
|
||||
|
||||
# GET left (user input)
|
||||
try:
|
||||
left = int(input("Left side: "))
|
||||
except ValueError:
|
||||
print("Invalid input!")
|
||||
exit(1)
|
||||
|
||||
# GET right (user input)
|
||||
try:
|
||||
right = int(input("Right side: "))
|
||||
except ValueError:
|
||||
print("Invalid input")
|
||||
exit(1)
|
||||
|
||||
add = left + right
|
||||
sub = left - right
|
||||
mul = left * right
|
||||
div = left / right
|
||||
|
||||
print("left + right =", add)
|
||||
print("left - right =", sub)
|
||||
print("left * right =", mul)
|
||||
print("left / right =", div)
|
||||
Reference in New Issue
Block a user