Question: Write a function displayNames ( ) which takes a filename, filename, as a parameter. This function will display the list of names in a single

Write a function displayNames () which takes a filename, filename, as a parameter. This function will display the list of names in a single column, shown below. Use file USSenate.csv.
Note: Entire list is not displayed to conserve page spaceWrite a function findAvgAge () that takes a filename, USSenate.csv, as a parameter and returns the average age of the senate. The file USSenate is a comma separated file in the order: lastname,firstname,state,age,years in senate. findAvgAge will read the file and compute the average age of the senate. Hint: use readlines().Write a function findSenators () that returns the names of the two senators from a state. findSenatords() will take two parameters, the filename and the state's name. The function will print the 2 names together as one string.
 Write a function displayNames () which takes a filename, filename, as

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 Databases Questions!