GH avatar Bite 21. Query a nested data structure

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.

Login and get coding
go back Beginner level
Bitecoin 2X

805 out of 880 users completed this Bite.
Will you be Pythonista #806 to crack this Bite?
Resolution time: ~56 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.16 on a 1-10 difficulty scale.
» Up for a challenge? 💪

We use Python 3.7