Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to complete the following assignment in pycharm: write a program that reads the contents of the two files into separate lists. The user

I need to complete the following assignment in pycharm:

write a program that reads the contents of the two files into separate lists. The user will then be able to enter a name and the application will display messages indicating whether the name is among the most popular in each list and where the name ranked in each list.

I currently have this: which is where I took the files of the girls and boys name and appended them into a list. I know this is right. What I am struggling on is creating a while loop to ask the user to input a name.

image text in transcribed

the run of the solution should look like this. Thanks! image text in transcribed

girlsName= [] girlsFile-open ("GirlNames.txt','r') for line in girlsFile: line-line.rstrip("In') girlsName.append (line) boysName[ boys File = open ( ' BoyNames . txt ' , for line in boysFile: ' r ' ) line = line . rstrip ( ' ' ) boysName.append (line)

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago