Mega Code Archive

 
Categories / Python Tutorial / Function
 

A dictionary containing all keyword arguments whose keyword doesnt correspond to a formal parameter

def cheeseshop(kind, *arguments, **keywords):     print "- Do you have any", kind, '?'     print "- I'm sorry, we're all out of", kind     for arg in arguments: print arg     print '-'*40     for kw in keywords.keys(): print kw, ':', keywords[kw] cheeseshop('Limburger', "It's very runny, sir.",             "It's really very, VERY runny, sir.",             client='John Cleese',             shopkeeper='Michael Palin',             sketch='Cheese Shop Sketch')