Skip to content

modification in code #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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))