Skip to content

Commit

Permalink
Merge pull request #1 from MSGanbold/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
MSGanbold authored Jul 22, 2019
2 parents 9472dde + 4daf4ec commit 99eb972
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
num_1 = input('Enter the first digit')
num_2 = input('Enter the second digit')
operator = input('Enter the operation sign')

if num_1.isdigit() and num_2.isdigit():
num_1 = int(num_1)
num_2 = int(num_2)

result = None
if operator == '+':
result = num_1 + num_2
elif operator == '-':
result = num_1 - num_2
elif operator == '/':
result = num_1 / num_2
elif operator == '*':
result = num_1 * num_2
else:
print('Unknown Operator!')
if result!= None:
print('{} {} {} = {}'.format(
num_1,
operator,
num_2,
result))

0 comments on commit 99eb972

Please sign in to comment.