Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Exercise 1 (100 pts) For this assignment, you will work with the data files provided in the names folder in the files section of

PYTHON

Exercise 1 (100 pts)

For this assignment, you will work with the data files provided in the "names" folder in the files section of this class. These files contain national data on the relative frequency of given names in the population of U.S. births where the individual has a Social Security Number. For each year of birth YYYY after 1879, there is a comma-delimited file called yobYYYY.txt. Each record in the individual annual files has the format "name,sex,number," where "name" is 2 to 15 characters, "sex" is M (male) or F (female) and "number" is the number of occurrences of the name. Each file is sorted first on sex and then on number of occurrences in descending order.

Write a Python program that iterates through all the data files in the folder and calculates the total number of occurrences of a given name. Your program should do the following:

Ask the user for a name they're interested in

Go through all the data files and find every instance of that name, adding them up to a total

Display the total number of instances of the given name.

For example, for the name "Alejandro" your program should perform as follows

What name are you interested in? Alejandro Alejandro has been used a total of 132243 times

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

Students also viewed these Databases questions

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago