Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 29, 2024. It is now read-only.

Commit 8a202df

Browse files
Create task1.py and created task1
1 parent aadb2ea commit 8a202df

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎ch_nandu/task1/task1.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#a simple python program to perform basic tasks like addition,subtraction,multiplication,division
2+
print('please select any of the number for performing arithmetic operations')
3+
print("1.Addition")
4+
print('2.Subtraction')
5+
print('3.Multiplication')
6+
print('4.Division')
7+
print('5.exit')
8+
a=int(input('Enter any of the number for performing arithmetic operations'))
9+
def ari(a,var1,var2):
10+
a,var1,var2=a,var1,var2
11+
if(a==1):
12+
print(var1+var2)
13+
if(a==2):
14+
print(var1-var2)
15+
if(a==3):
16+
print(var1*var2)
17+
if(a==4):
18+
print(var1/var2)
19+
return
20+
21+
#Enter Two numbers
22+
if((a>0) and (a<5)):
23+
var1 = int(input('Enter First number: '))
24+
var2 = int(input('Enter Second number: '))
25+
ari(a,var1,var2)
26+
elif(a==5):
27+
exit()
28+
else:
29+
print('Invalid Option')
30+
print('please select 1/2/3/4/5 only')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /