Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions Simple-Calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,4 @@ def modulo(num1, num2):
except ValueError:
print("Invalid input. Please enter a number.")
else:
print("Invalid option. Try running the program again.")

# performs the function based on the input received
if choice == 1:
# returns added numbers
print(num1, "+", num2, "=", add(num1, num2))

elif choice == 2:
# returns subtracted numbers
print(num1, "-", num2, "=", subtract(num1, num2))

elif choice == 3:
# returns multiplied numbers
print(num1, "x", num2, "=", multiply(num1, num2))

elif choice == 4:
# returns divided numbers
print(num1, "/", num2, "=", divide(num1, num2))

elif choice == 5:
# returns modulus (i.e. the remainder of num1/num2)
print(num1, "%", num2, "=", modulo(num1, num2))