Question
Write a function, called senators_info, that takes a filename string # as an argument. It should load the json file and extract the Senator's #
Write a function, called senators_info, that takes a filename string # as an argument. It should load the json file and extract the Senator's # following information:
# First name
# Last name
# State
# Party
# Start date (since when they've been Senators)
# Congress number (which sessions of Congress they were Senators for)
# Contact form
# Phone number
# Twitter handle
# Birthday
# Nickname
# The function should write the senators information to a json file # called senators_info.json. Use an indent of 2 to make the data more # readable. The function should also return the data, this should # be a list of dictionaries. # Hint: You may want to use the get() method when getting the data
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started