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
Leave a Reply