Popular Names The 2 data files: boynames.txt and girlnames.txt each contain a list of the 1000 most popular names for boys and girls in the U.S. for the year 2021 as compiled by the Social Security Administration. These are blank-delimited files where the names are listed in order of popularity (the most popular name is listed first and the 1000th most popular name listed last). Each line consists of the name followed by a blank space and then the number of registered births using that name in the year. Write a program that reads both the girl's and boy's files into memory using a dictionary. The key should be the name and value should be a user defined object which is the count and rank of the name. Allow the user to input a name, the program should find the name (regardless of user's input letter case - i.e. upper or lower case) in the dictionary and print out the rank and the number of names. If the name isn't a key in the dictionary, then the program should indicate this. The program continues until "-1" is entered, and should say Exiting program. when this happens. The first two lines, I need to open text files boynames and girlnames Thank you so much and have a great day
Python Code please
Popular Names
The 2 data files: boynames.txt and girlnames.txt each contain a list of the 1000 most popular names for boys and girls in the U.S. for the year 2021 as compiled by the Social Security Administration. These are blank-delimited files where the names are listed in order of popularity (the most popular name is listed first and the 1000th most popular name listed last). Each line consists of the name followed by a blank space and then the number of registered births using that name in the year.
Write a
The first two lines, I need to open text files boynames and girlnames
Thank you so much and have a great day
![Popular Names
The 2 data files: boynames.txt and girlnames.txt each contain a list of the 1000 most popular names for boys and girls in the U.S. for the year 2021 as
compiled by the Social Security Administration. These are blank-delimited files where the names are listed in order of popularity (the most popular name is
listed first and the 1000th most popular name listed last). Each line consists of the name followed by a blank space and then the number of registered births
using that name in the year. For example, the girlnames.txt file begins with:
Olivia 17728
Emma 15433
Charlotte 13285
This indicates that Olivia was the most popular name with 17,728 registered names, Emma was the second most popular with 15,433 and Charlotte was the
third most popular with 13,285.
Write a program that reads both the girl's and boy's files into memory using a dictionary. The key should be the name and value should be a user defined
object which is the count and rank of the name. Allow the user to input a name, the program should find the name (regardless of user's input letter case - i.e.
upper or lower case) in the dictionary and print out the rank and the number of names. If the name isn't a key in the dictionary, then the program should
indicate this. The program continues until "-1" is entered, and should say Exiting program. when this happens.
Example if the user enters "noah":
Enter a name (-1 to exit): noah
Noah is ranked 2 in popularity among boys with 18739 namings.
Noah is ranked 692 in popularity among girls with 415 namings.
Enter a name (-1 to exit):
Example if the user enters "ARYA":
Enter a name (-1 to exit): ARYA
Arya is not ranked among the top 1000 boy names.
Arya is ranked 120 in popularity among girls with 2320 namings.
Enter a name (-1 to exit):](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1f559ff2-7390-4b86-9602-ab51f205485c%2F3216d629-9ddd-418e-90a7-dbe25df22a64%2Fffe66sa_processed.png&w=3840&q=75)
![Example if the user enters "noah":
Enter a name (-1 to exit): noah
Noah is ranked 2 in popularity among boys with 18739 namings.
Noah is ranked 692 in popularity among girls with 415 namings.
Enter a name (-1 to exit):
Example if the user enters "ARYA":
Enter a name (-1 to exit): ARYA
Arya is not ranked among the top 1000 boy names.
Arya is ranked 120 in popularity among girls with 2320 namings.
Enter a name (-1 to exit):
Example if the user enters "mITZY":
Enter a name (-1 to exit): mITZY
Mitzy is not ranked among the top 1000 boy names.
Mitzy is not ranked among the top 1000 girl names.
Enter a name (-1 to exit):
Example if the user enters "-1":
Enter a name (-1 to exit): -1
Exiting program.
• Rectangular Snip](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1f559ff2-7390-4b86-9602-ab51f205485c%2F3216d629-9ddd-418e-90a7-dbe25df22a64%2Fiv7oend_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 5 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)