In Python, functions are defined as a block of code that is executable only when it is called. The def keyword is used to define a function in Python.
Example:
1
2
3
def Func():
print("Hello, Welcome toMadanswer")
Func(); #calling the function
Output: Hello, Welcome to Madanswer