-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.py
More file actions
54 lines (33 loc) · 703 Bytes
/
function.py
File metadata and controls
54 lines (33 loc) · 703 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
31
32
33
34
35
36
37
38
39
40
41
42
43
# Function
def great():
print("welcome to the function")
great()
#parameter passing function
def know(name):
print(f"hello {name}, Welcome")
know("sanoop")
def add(a,b):
print(a+b)
add(4,6)
# Return Function
def total(a,b,c):
return a+b+c
result=total(34,56,78)
print(result)
# args function
def cal(*args):
total=0
for num in args:
total+=num
#0+=1
#1+=2
#3+=2
#5
return total
print(cal(1,2,2))
# kwargs function
def profile(**kwargs):
print("Your Profile")
for key, value in kwargs.items():
print(f"{key} -> {value}")
profile(name="Sanoop",age=22,Email="sanoops58@gmail.com",place="france")