Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
*args and **kwargs
In def route(path, /, version, *parts, strict=True, **metadata), which classification is …
from *args and **kwargs
Python 3.14
intermediate
3 min
In def route(path, /, version, *parts, strict=True, **metadata), which classification is correct?
path is positional-only; version is positional-or-keyword; parts is variadic positional; strict is keyword-only; metadata is variadic keyword.
path and version are positional-only; strict is collected in metadata.
parts collects every argument after version, including strict.
metadata may also collect surplus positional arguments.
Check
Ask AI about this kata
Report an error
next kata
What happens when capture is defined as def capture(**metadata) and called as capture(**{…
Quiz
A new version is available
Reload