Question: Build a dictionary patron_dict in Python to read in the library patrons information stored in a list patrons For each element in the list, the
Build a dictionary patron_dict in Python to read in the library patrons information stored in a list patrons
For each element in the list, the first number is the patron id, the next is the name of the book or DVD the patron borrowed.
Please use patron id as key, and book or DVD name as associated value in the dictionary to combine these information.
Please show the newly created dictionary in an ascending order based on patron id.
Hint:
- Please apply proper methods to remove the leading and trailing spaces in the patron id or the name of the book or DVD
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
