forked from CSEdgeOfficial/Python-Programming-Internship
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTASK-1.py
30 lines (29 loc) · 857 Bytes
/
TASK-1.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
#a simple python program to perform basic tasks like addition,subtraction,multiplication,division
print('please select any of the number for performing arithmetic operations')
print("1.Addition")
print('2.Subtraction')
print('3.Multiplication')
print('4.Division')
print('5.exit')
a=int(input('Enter any of the number for performing arithmetic operations'))
def ari(a,var1,var2):
a,var1,var2=a,var1,var2
if(a==1):
print(var1+var2)
if(a==2):
print(var1-var2)
if(a==3):
print(var1*var2)
if(a==4):
print(var1/var2)
return
#Enter Two numbers
if((a>0) and (a<5)):
var1 = int(input('Enter First number: '))
var2 = int(input('Enter Second number: '))
ari(a,var1,var2)
elif(a==5):
exit()
else:
print('Invalid Option')
print('please select 1/2/3/4/5 only')