Python functions are 'typeless' : Function Parameters « Function « Python






Python functions are 'typeless'

Python functions are 'typeless'

def times(x, y):      # create and assign function
     return x * y      # body executed when called



print times('Ni', 4)        # functions are 'typeless'

           
       








Related examples in the same category

1.Four different ways to pass parametersFour different ways to pass parameters
2.Passing value or passing addressPassing value or passing address
3.Pass string value into a functionPass string value into a function
4.Pass immutable and mutable value into functionPass immutable and mutable value into function