Get the data for baby names for 2014 from the Social Security Administration web
ID: 3859206 • Letter: G
Question
Get the data for baby names for 2014 from the Social Security Administration website at https://www.ssa.gov/oact/babynames/#&ht=1.
Using Notepad, paste the table data from the website into a text file named babynames2014.txt. (Get the top 100 names for 2014.)
Design a Python program which will read in the names from the babynames2014.txt file and then create two files – separating the boy names and the girl names. The resulting files should be called boynames2014.txt and girlnames2014.txt.
***Use a try/except block to handle the exception – in case the babynames2014.txt file is not found or unavailable.
Explanation / Answer
NOTE: I have completed the code for your assignment and shared the same in below links. I even have demonstrated how try, catch block works when the file babynames2014.txt does not exist. Please check and let me know if you face any issues. I will revert back within 24 hours.
Code:
http://pasted.co/152dfd66
Code execution output screenshot:
https://pasteboard.co/GC2zu9N.png
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.