Python 16 Programming Tutorial - Keyword Arguments

def dumb_sentence(name='Bucky', action='ate', item='tuna'):
    print(name, action, item)

dumb_sentence()
dumb_sentence("Sally", "farts", "gently")
dumb_sentence(item='awesome')
dumb_sentence(item='awesome', action='is')

你可能感兴趣的:(Python 16 Programming Tutorial - Keyword Arguments)