Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MSGanbold authored Jul 19, 2019
1 parent 0cf139f commit 9472dde
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
# an elementary calculator code

```python
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 9472dde

Please sign in to comment.