Question: Please show the python code you use! I understand the basic inputs and exception statements, but pulling the info from the files and the gender

 Please show the python code you use! I understand the basic

Please show the python code you use! I understand the basic inputs and exception statements, but pulling the info from the files and the gender validation stumped me!

536173 18course id 571941 Baby Names Objectives: To practice reading data from a file . To practice exception handling To practice validation loops . To practice writing functions Assignment: This assignment adapted from the "Nifty Assignments" session at SIGCSE. Against all bureaucratic stereotypes, the Social Security Administration provides a neat web site showing the distribution of names chosen for kids over the last 140 years in the USA (https://www.ssa.gov/OACT/babynames/decades/). Every 10 years, the data gives the 200 most popular boy and girl names for kids born in the USA Your program will use one of these files (found on myCourses). Your program will ask the user for the name of the file and then open that file. It will also prompt the user for a full name and gender of the baby name. Be sure to validate the gender. Your program will then search the file for the first name in the appropriate column (one column for boys another for girls). If the name is found, the rank for that name should be printed to the screen. If the name is not found, then that should be reported as well Be sure that your program uses a main function and at least one other function. No global variables may be used In order to get to the individual pieces of data on each line that is read from the file, you will need to split the string using the .split) function. You will need to have a list of variables long enough to hold all of the pieces of data. If you were given a string containing first president's full name, full name George Washington", you would need to split it like this: first, lastfull name. split) After the function has run, then first will have "George", and last will have Washington". The.split() function splits the string at all white space characters. Your program must handle all possible exceptions that may raise. For 10 points bonus, modify your program so that it reports the rank for each of the decades provided (1950s - 2010s). Hint: Place entire search in a function. 536173 18course id 571941 Baby Names Objectives: To practice reading data from a file . To practice exception handling To practice validation loops . To practice writing functions Assignment: This assignment adapted from the "Nifty Assignments" session at SIGCSE. Against all bureaucratic stereotypes, the Social Security Administration provides a neat web site showing the distribution of names chosen for kids over the last 140 years in the USA (https://www.ssa.gov/OACT/babynames/decades/). Every 10 years, the data gives the 200 most popular boy and girl names for kids born in the USA Your program will use one of these files (found on myCourses). Your program will ask the user for the name of the file and then open that file. It will also prompt the user for a full name and gender of the baby name. Be sure to validate the gender. Your program will then search the file for the first name in the appropriate column (one column for boys another for girls). If the name is found, the rank for that name should be printed to the screen. If the name is not found, then that should be reported as well Be sure that your program uses a main function and at least one other function. No global variables may be used In order to get to the individual pieces of data on each line that is read from the file, you will need to split the string using the .split) function. You will need to have a list of variables long enough to hold all of the pieces of data. If you were given a string containing first president's full name, full name George Washington", you would need to split it like this: first, lastfull name. split) After the function has run, then first will have "George", and last will have Washington". The.split() function splits the string at all white space characters. Your program must handle all possible exceptions that may raise. For 10 points bonus, modify your program so that it reports the rank for each of the decades provided (1950s - 2010s). Hint: Place entire search in a function

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!