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
6 changes: 3 additions & 3 deletions calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Asks user for 2 operands and 1 operator
# Returns output of this operation

a=input("Enter number 1 : ")
a=int(input("Enter number 1 : "))
o=input("Enter operator : ")
b=input("Enter number 2 : ")
b=int(input("Enter number 2 : "))

if o[0] in [ '+','-','*','/' ]:
if o[0] == '+':
Expand All @@ -17,7 +17,7 @@
elif o[0] == '*':
out = a * b
elif o[0] == '/':
out = a//b
out = a/b
print("Output : ",out)
else:
print("Error : Invalid Operator")