-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.py
More file actions
81 lines (57 loc) · 1.71 KB
/
print.py
File metadata and controls
81 lines (57 loc) · 1.71 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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'''#student details
name = "san"
clg = "cit"
age = 28
email = "san@gmail.com"
mobile = 9999
print("name =" ,name);print("clg =" ,clg);print("age =" ,age);print("email =" , email);print("mobile =",mobile)'''
'''
name = input("name = ")
clg = str(input("clg = "))
age = int(input("age = "))
email = str(input("email = "))
mobile = int(input("mobile = "))
print ( " name =",name,"\n","clg =",clg,"\n","age =","\n","email =",email,"\n","mobile =",mobile)
'''
#calculation
def func():
def Mycalculate(a, b):
print("Addition")
z = a + b
print("The addition of z is =", z)
def Mysubraction(a, b):
print("Subraction")
d = a - b
print("The Subraction of d is =", d)
def muldiv(a, b):
print("Multiplication")
e = a * b
print("The multiplication of e is =", e)
def division(a, b):
print("Division")
c = a/b
print("The division of c is =", c)
while True :
a = int(input("Input for a = "))
b = int(input("Input for b = "))
print("\nEnter your choice:")
print("1. Addition")
print("2. Subraction")
print("3. Multiplication")
print("4. Division")
choice = input("Enter your choice = ")
if choice == '1':
Mycalculate(a, b)
elif choice == '2':
Mysubraction(a, b)
elif choice == '3':
muldiv(a, b)
elif choice == '4':
division(a, b)
else:
print("Invalid choice. Please try again.")
again = input("Do you want to re-enter? (yes/no): ")
if again != "yes":
print("Exiting program.")
break
func()