-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.py
More file actions
40 lines (29 loc) · 1.1 KB
/
calculator.py
File metadata and controls
40 lines (29 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import math
print('MY SIMPLE CALCULATOR PROJECT')
name = input(f'Can I get to know your name please 🤗? ')
print(f'Hello there {name}! Let\'s get your values down?')
while True:
try:
_nu1 = int(input(f'First Value: '))
_nu2 = int(input(f'Second Value: '))
except :
print('The Value You Entered is Not A Number')
else:
break
while True:
print('What operation would you like to perform? Addition, Subtraction, Multiplication, Division, Modulus')
op_ = input(f'>> ')
if (op_.lower()) == 'addition':
print(int(_nu1) + int(_nu2))
elif (op_.lower()) == 'subtraction':
print(int(_nu1) - int(_nu2))
elif (op_.lower()) == 'multiplication':
print(int(_nu1) * int(_nu2))
elif (op_.lower() == 'division'):
print(int(_nu1) // int(_nu2))
elif (op_.lower() == 'modulus'):
print(int(_nu1) % int(_nu2))
else:
print('I\'m Very Sorry This Function Has Not Been Added To My Functionality By My Developer')
continue
break