-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculator.py
56 lines (56 loc) · 1.33 KB
/
Calculator.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
print ("Welcome to my Calculator")
print (' ')
loop = 1
opperand = 0
while loop == 1:
opperand = input('Press'+'\n'+
'A for Addition'+'\n'+
'S for Substraction'+'\n'+
'M for Multiplication'+'\n'+
'D for Division'+'\n'+
'B for Square'+'\n'+
'SR for Square root'+'\n'+
'Q for Quit'+'\n'+
':::::---')
print (' ')
if opperand == ('A') or opperand == ('a'):
a = int(input('1st Number::---'))
b = int(input('2nd Number::---'))
print (' ')
print (a+b)
print (' ')
elif opperand == ('S') or opperand == ('s'):
a = int(input('1st Number::---'))
b = int(input('2nd Number::---'))
print (' ')
print (a-b)
print (' ')
elif opperand == ('M') or opperand == ('m'):
a = int(input('1st Number::---'))
b = int(input('2nd Number::---'))
print (' ')
print (a*b)
print (' ')
elif opperand == ('D') or opperand == ('d'):
a = int(input('1st Number::---'))
b = int(input('2nd Number::---'))
print (' ')
print (a/b)
print (' ')
elif opperand == ('B') or opperand == ('b'):
a = int(input('Number::---'))
b = 2
print (' ')
print (a**b)
print (' ')
elif opperand == ('SR') or opperand == ('Sr') or opperand == ('sr') or opperand == ('sR'):
a = int(input('Number::---'))
b = 0.5
print (' ')
print (a**b)
print (' ')
elif opperand == ('Q') or opperand ==('q'):
loop = 0
print ("THANK YOU")
print (' ')
print ("VISIT AGAIN")