A function definition : Function Define « Function « Python






A function definition

A function definition
 

def square(x):
    'Calculates the square of the number x.'
    return x*x


print square(100)

           
         
  








Related examples in the same category

1.Power functionPower function
2.Define simple function in PythonDefine simple function in Python
3.A function that writes the Fibonacci series to an arbitrary boundaryA function that writes the Fibonacci series to an arbitrary boundary
4.Define a function in PythonDefine a function in Python
5.Function call
6.Factorial functionFactorial function