Question: How do I fix this Type Error? Problem 4 (4 pts.): Create a list of dictionaries (ar_dict), where each dictionary has two keys: Author and
How do I fix this Type Error?

Problem 4 (4 pts.): Create a list of dictionaries (ar_dict), where each dictionary has two keys: "Author" and "Comments", by iterating over the list of eviews and for each review constructing a dictionary containing the author's name and comments and then appending it to the list of dictionaries we are reating ar_lst =[] for review in reviews: \# TODO: (1) Create a dictionary, ar_dict, containing just two keys, "Author" and "Comments". " Their values should be obtained from the current review dictionary stored in the "review" variable. # (2) Append this newly constructed dictionary, ar_dict, to the ar_lst list. \# ar_dict = \{"Author":review[ [Author'], "Comments":review ['Content']\} ar_lst.append(ar_dict) \# Let us check that we have 233 elements in the ar_lst list. print(f'There are { len(ar_lst) } elements in the list.') TypeError Traceback (most recent call last) (2) Append this newly constructed dictionary, ar_dict, to the ar_lst list. TypeError: string indices must be integers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
