Chapter 4. More Control Flow Tools 24 Python Tutorial, Release 3.9.5 (continued from previous page) It could be called like this: and of course it would print: Note that the order in which the keyword arguments are printed is guaranteed to match the order in which they were provided in the function call. By default, arguments may be passed to a Python function either by position or explicitly by keyword. For readability and performance, it makes sense to restrict the way arguments can be passed so that a developer need only look at the function definition to determine if items are passed by position, by position or keyword, or by keyword. A function definition may look like: where$_{/}$and$_{*}$are optional. If used, these symbols indicate the kind of parameter by how the arguments may be passed to the function: positional-only, positional-or-keyword, and keyword-only. Keyword parameters are also referred to as named parameters. If$_{/}$and$_{*}$are not present in the function definition, arguments may be passed to a function by position or by keyword. Positional-or-Keyword Arguments 4.7.3 Special parameters print("-"*40 ) for kw in keywords: print(kw,":", keywords[kw]) cheeseshop("Limburger","It's very runny, sir. ", "It's really very, VERY runny, sir. ", shopkeeper="Michael Palin ", client="John Cleese", sketch="Cheese Shop Sketch ") -- Do you have any Limburger ? -- I'm sorry, we're all out of Limburger It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- shopkeeper : Michael Palin client : John Cleese sketch : Cheese Shop Sketch def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2): ----------- ---------- | | | | Positional or keyword | | - Keyword only -- Positional only