What are functions in Python?

A function is a segment of code that runs only when it is called. The “def” keyword is utilized to define a specific function, as exemplified below:

def my_function():     print("Hi, Welcome to Intellipaat") my_function()  # call to the function

Output:
Hi, Welcome to Intellipaat


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *