forked from chavarera/PythonScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.BasicOfFunction.py
More file actions
30 lines (23 loc) · 758 Bytes
/
1.BasicOfFunction.py
File metadata and controls
30 lines (23 loc) · 758 Bytes
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
#function procedure when we need to do some task then the best way to reuse our code
# so function can help
#Function or procedure syntax def functionname(variabl1,variable2..):
# return calculation
#to define a function def keyword is used
#addition function
def addition(a,b):
return a+b
def substraction(a,b):
return a-b
def multiply(a,b):
return a*b
print("Addtion is ")
print(addition(19,8)) #calling a function
print("Substraction is ")
print(substraction(19,8)) #calling substraction function
print("Multiplication is ")
print(multiply(19,8)) #calling multiplication function
x=input("Enter First Number:")
y=input("Enter Second Number:")
z=(addition(int(x),int(y))) #sending user input function
print("Your Answer")
print(z)