First page Back Continue Last page Overview Graphics

Keyword Parameter

This is an alternative way to call a function.

The definition of the function doesn't change.

def sumsub(a, b, c=0, d=0):

return a - b + c - d

>>> from funktion1 import sumsub

>>> sumsub(12,4)

8

>>> sumsub(12,4,27,23)

12

>>> sumsub(12,4,d=27)

Keyword parameters can only be those, which haven't been used as postional parameters.