Stuff
This commit is contained in:
35
old/activity2-core.py
Normal file
35
old/activity2-core.py
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user