def
def is used to define a user-defined function.
Function is a block of related statements, which together does some specific task. It helps us organize code into manageable chunks and also to do some repetitive task.
The usage of def is shown below:
def function_name(parameters):
…