-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython.py
65 lines (44 loc) · 1.17 KB
/
python.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
import math
message = "\t Stanley's cat"
print(message)
for x in range(0, 5):
print(x)
print (ord('*'))
def addition(a, b):
return (a+b)
def subtraction(a,b):
return (a - b)
def Division(a,b):
return (a/b)
def modulors(a,b):
return (a%b)
def multi(a,b):
return (a*b)
def display_func():
print("CHOICES")
print("1.add \n 2.subtract \n 3.modulors\
\n 4.Divide \n 5.miltiplication")
choices =(input("Enter choice: "))
print("Enter two numbers")
f_num = input("Enter a number: ")
f_num = int(f_num)
s_num = input("enter a number: ")
s_num = int(s_num)
if choices=='1':
add_func= addition(f_num , s_num)
print(add_func)
elif choices=='2':
sub_func = subtraction(f_num, s_num)
print(sub_func)
elif choices=='3':
modulors_func = modulors(f_num, s_num)
print(modulors_func)
elif choices=='4':
div_func =Division(f_num, s_num)
print(div_func)
elif choices=='5':
mul_func = multi(f_num, s_num)
print(mul_func)
else:
print("ooops! Check the menu again and make the right choice")
display_func()