Skip to content

Instantly share code, notes, and snippets.

@Manohar11
Last active January 17, 2019 08:23
Python user defined function
#Python user defined function - Syntax
"""
def function_name(parameters):
'''doc string '''
[Block statements]
[return statement]
"""
#Example
x, y = 10, 30
#Python user defined function
def summation(x, y):
''' Summation of two numbers
example: c = a + b '''
z = x + y
return z
#Function call
print("Sum of two numbers = ", summation(x, y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment