-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheigth3.py
65 lines (59 loc) · 1.62 KB
/
eigth3.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
57
58
59
60
61
62
63
64
65
t=True
n=True
f=True
import math
print("Calculator")
while t:
num1=input("Give the first number:")
try:
num1=int(num1)
t=False
except(TypeError,ValueError):
print("This input is invalid.")
t=True
while f:
num2=input("Give the second number:")
try:
num2=int(num2)
f=False
except(TypeError,ValueError):
print("This input is invalid.")
f=True
while n :
print("(1) +")
print("(2) -")
print("(3) *")
print("(4) /")
print("(5)sin(number1/number2)")
print("(6)cos(number1/number2)")
print("(7)Change numbers")
print("(8)Quit")
print("Current numbers:",+num1,+num2)
select=input("Please Select something (1-6):")
if(select=='1'):
print("The result is:",+(num1+num2))
n=True
elif(select=='2'):
print("The result is:",+(num1-num2))
n=True
elif(select=='3'):
print("The result is:",+(num1*num2))
n=True
elif(select=='4'):
print("The result is:",+(num1/num2))
n=True
elif(select=='5'):
print("The result is:",+ (math.sin(num1/num2)))
n=True
elif(select=='6'):
print("The result is:",+ (math.cos(num1/num2)))
n=True
elif(select=='7'):
t=False
elif(select=='8'):
print("Thank you!")
t=False
f=False
n=False
else:
n=True