+ 1
Python. Can someone please explain me for what do we use def ()?
2 Respostas
+ 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