This commit is contained in:
Maxwell Jeffress
2026-02-20 11:42:22 +11:00
commit 3fdb90a652
5 changed files with 189 additions and 0 deletions

35
old/activity2-core.py Normal file
View File

@@ -0,0 +1,35 @@
# Created by Maxwell Jeffress on 13/02/2026
# Does operations on values
left = 0
right = 0
op = ""
while True:
try:
left = int(input("Left: "))
except ValueError:
print("Invalid input")
continue
try:
right = int(input("Right: "))
except ValueError:
print("Invalid input")
continue
op = input("Operation: ")
match op:
case "+":
print(left + right)
case "-":
print(left - right)
case "*":
print(left * right)
case "/":
print(left / right)
case _:
print("That's not an operation")
if input("Continue? (y/N) ") != "y":
break