argument.py
#The default argument for desert is orange
def menu(drink, food, desert = 'orange'):
print('drink:', drink)
print('food:',food)
print('desert:', desert)
#Function call by keyword argument (default argument is passed because desert does not specify anything)
menu(food ='egg', drink = 'beer')
Output result:
drink: beer
food: egg
desert: orange
Recommended Posts