Function create block of code.
Syntax:
def name_of_function(num1, num2) :
return num1+num2 #Indentation is required
Example:
def name_function():
return 'babu'
>>> name_function()
'babu'
Create Help Notes in Function
>>> def name_function():
'''
fdfdf
'''
print('hello')
>>> help(name_function)
Help on function name_function in module __main__:
name_function()
fdfdf
Methods: are In built objects
Syntax:
def name_of_function(num1, num2) :
return num1+num2 #Indentation is required
Example:
def name_function():
return 'babu'
>>> name_function()
'babu'
Create Help Notes in Function
>>> def name_function():
'''
fdfdf
'''
print('hello')
>>> help(name_function)
Help on function name_function in module __main__:
name_function()
fdfdf
Methods: are In built objects