python generalizes the ordering rules in function headers to allow us to specify keyword-only arguments--arguments that must be passed by keyword only and will never be filled in by positional argument this is useful if we want function to both process any number of arguments and accept possibly optional configuration options syntacticallykeyword-only arguments are coded as named arguments that may appear after *args in the arguments list all such arguments must be passed using keyword syntax in the call for examplein the followinga may be passed by name or positionb collects any extra positional argumentsand must be passed by keyword only in xdef kwonly( *bc)print(abckwonly( = ( , kwonly( = = ( kwonly( typeerrorkwonly(missing required keyword-only argument'cwe can also use character by itself in the arguments list to indicate that function does not accept variable-length argument list but still expects all arguments following the to be passed as keywords in the next functiona may be passed by position or name againbut and must be keywordsand no extra positionals are alloweddef kwonly( *bc)print(abckwonly( = = kwonly( = = = kwonly( typeerrorkwonly(takes positional argument but were given kwonly( typeerrorkwonly(missing required keyword-only arguments'band 'cyou can still use defaults for keyword-only argumentseven though they appear after the in the function header in the following codea may be passed by name or positionand and are optional but must be passed by keyword if useddef kwonly( * ='spam' ='ham')print(abckwonly( spam ham kwonly( = spam kwonly( = spam ham kwonly( = = = special argument-matching modes