+ 1
Python. Can someone please explain me for what do we use def ()?
2 Answers
+ 10
def is a keyword that is used to define a function in python
e.g.đ
#function definition
def sum(a,b):
return a+b
#function calling
print(sum(7, 6))
Output:đ13
-----------------------------------------------------
hope you got the answer đ€
+ 1
def is used to define functions
def func():
Func statements
func() #Execution/Calling