+ 1
What is function of def() in python
2 Answers
+ 5
There is no def() in python i think.
There is def keyword in python and
def followed by identifier with( <arguments> ) :
<function body>
will tells the interpreter the this is a function definition
ex: a function add for adding two numbers and returns sum, is :
def add( a, b ) :
sum_ab = a + b
return sum_ab;
You can use or call it as
print( add(4, 5))
or
Add = add(4, 5)
print( Add)
+ 1
Thanx