Intermediate
Read a pyproject.toml
Write project_info(text). Its input text is the whole content of a pyproject.toml file, as one string. Parse it with tomllib.loads and return a tuple (name, dependencies): the project name and the dependencies list, both from the [project] table.
If the [project] table has no dependencies key, return an empty list for it.
What Check tests
- Reads name and dependencies
- Missing dependencies gives []
- Two dependencies are kept in order
- Other tables are ignored, even when they come first
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
main.py
Sign in to run your code.
Output
Press Run to see what your program prints.