create a dictionary of dictionaries where each key in the outer dictionary is an author whose last name starts with the letter 'S'. - Each inner dictionary should contain the number of books that author has written as 'Number of Books' - It should contain the earliest book title for that author based on year with the key 'First Book' - Finally it should contain the latest book title for that author based on year with the key 'Last Book' - If an author has only one book put the same title in both places - Return the dictionary of dictionaries def author_history(cleaned_list): Args: cleaned_list (list) Returns: dictionary of dictionaries Output: {'SafranFoer,Jonathan': {'First Book': 'ExtremelyLoudandIncrediblyClose', 'Last Book': 'ExtremelyLoudandIncrediblyClose', 'Number of Books': 1}, 'Salter,James': {'First Book': 'LastNight', 'Last Book': 'LastNight', 'Number of Books': 1}, ... 'Szado,Ania': {'First Book': 'StudioSaintEx', 'Last Book': 'StudioSaintEx', 'Number of Books': 1}}
import json, datetime, csv
from pprint import pprint
Question 3
- Using the cleaned list of lists from question 1, create a dictionary of dictionaries
where each key in the outer dictionary is an author whose last name starts with the letter 'S'.
- Each inner dictionary should contain the number of books that author has written as 'Number of Books'
- It should contain the earliest book title for that author based on year with the key 'First Book'
- Finally it should contain the latest book title for that author based on year with the key 'Last Book'
- If an author has only one book put the same title in both places
- Return the dictionary of dictionaries
def author_history(cleaned_list):
Args:
cleaned_list (list)
Returns:
dictionary of dictionaries
Output:
{'SafranFoer,Jonathan': {'First Book': 'ExtremelyLoudandIncrediblyClose',
'Last Book': 'ExtremelyLoudandIncrediblyClose',
'Number of Books': 1},
'Salter,James': {'First Book': 'LastNight',
'Last Book': 'LastNight',
'Number of Books': 1},
...
'Szado,Ania': {'First Book': 'StudioSaintEx',
'Last Book': 'StudioSaintEx',
'Number of Books': 1}}

Python is the programming languages .Python which refers to the high-level, general purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python which is dynamically-typed and garbage collected. It supports the multiple programming paradigms and including structured and also object-oriented and functional programming.
Step by step
Solved in 3 steps









