We use Python 3.6

go back Level: Beginner (img: BG / score: 2) level Bite 21. Query a nested data structure

319 out of 357 users completed this Bite ...
Will you be Pythonista #320 to crack this Bite?
Average Bite difficulty 1-10 rating: 5.79
» Up for a challenge? 💪

Given the provided cars dictionary:

  1. Get all Jeeps
  2. Get the first car of every manufacturer.
  3. Get all vehicles containing the string Trail in their names (should work for other grep too)
  4. Sort the models (values) alphabetically

See the docstrings and tests for more details. Have fun!

Update 18th of Sept 2018: as concluded in the forum it is better to pass the cars dict into each function to make its scope local.

Github login button