Check sibling questions

What is the general syntax for defining a function in Python?

 

Answer:

General syntax for defining a function in python:

def function_name(parameters):

"""docstring"""

    statement1

    statement2

    ...

    ...

    return [expr]

Are ads bothering you?

CA Maninder Singh's photo - Expert in Practical Accounts, Taxation and Efiling

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.