File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #function procedure when we need to do some task then the best way to reuse our code
2+ # so function can help
3+ #Function or procedure syntax def functionname(variabl1,variable2..):
4+ # return calculation
5+ #to define a function def keyword is used
6+
7+ #addition function
8+ def addition (a ,b ):
9+ return a + b
10+
11+ def substraction (a ,b ):
12+ return a - b
13+
14+ def multiply (a ,b ):
15+ return a * b
16+
17+ print ("Addtion is " )
18+ print (addition (19 ,8 )) #calling a function
19+
20+ print ("Substraction is " )
21+ print (substraction (19 ,8 )) #calling substraction function
22+
23+ print ("Multiplication is " )
24+ print (multiply (19 ,8 )) #calling multiplication function
25+
26+ x = input ("Enter First Number:" )
27+ y = input ("Enter Second Number:" )
28+ z = (addition (int (x ),int (y ))) #sending user input function
29+ print ("Your Answer" )
30+ print (z )
You can’t perform that action at this time.
0 commit comments