Question: part A: question 1 : Extract specific values from the episode data Insert the code from the tutorial to use json.loads to convert the text

part A: question 1 :

Extract specific values from the episode data

Insert the code from the tutorial to use json.loads to convert the text string into a Python dictionary

  • Use json.loads to convert the text string into a Python dictionary
    • referencing the text portion of the response object get the name, airdate, runtime and summary values
    • assign the results to variable episode_data
  • Print each of the values using a separate print(...) statement on a separate line

# INSERT GET CODE USING JSON.LOADS TO GET THE NAME, AIRDATE, RUNTIME and SUMMARY

  • Get the first (only) list entry, the show dictionary entry and the id dictionary entry within the show dictionary values
    • NOTE: This can all be done with 1 line of code.
    • List entries are referenced using index values
    • Dictionary entries are referenced using key values
  • Save the show id in variable show_id
  • Print show_id ~ the value should be 44458
  • Question 2:

# INSERT CODE TO GET & PRINT THE 'TED LASSO' SHOW ID -- "id": 44458

#Get the first (only) list entry, the show dictionary entry and the id dictionary entry within the show dictionary values #show_id = json_data["id"][0]["show_id"] #json_data = json.loads (r.text)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!