Assume the file popular_names.txt contains the 400 most popular names given to children born in the United States from the year 2000 through 2009. The file contains 400 lines, with one name per line. Write a Python program that reads the contents of the file into a list. The program should display the following string to prompt the user to enter a name: 'Entet a name: ' The program should then display a message indicating whether the name is among the most popular. If the name is found in the list, the program should display the following message: 'That was a popular name between 2000 and 2009.' If the name is not found in the list, the program should display the following message: 'That was not a popular name between 2000 and 2009.' Look carefully at the samples given. In the first example, the user enters a name that is found in the list. In the second example, the user enters a name that is not found in the list. Carefully notice the wording of the messages and the placement of the spaces and colons. The program's output must match this. Sample Run 1: Enter a name: Isabella That was a popular name between 2000 and 2009. Sample Run 2: Enter a name: Voldemort That was not a popular name between 2000 and 2009.
Assume the file popular_names.txt contains the 400 most popular names given to children born in the United States from the year 2000 through 2009. The file contains 400 lines, with one name per line. Write a Python program that reads the contents of the file into a list. The program should display the following string to prompt the user to enter a name: 'Entet a name: ' The program should then display a message indicating whether the name is among the most popular. If the name is found in the list, the program should display the following message: 'That was a popular name between 2000 and 2009.' If the name is not found in the list, the program should display the following message: 'That was not a popular name between 2000 and 2009.' Look carefully at the samples given. In the first example, the user enters a name that is found in the list. In the second example, the user enters a name that is not found in the list. Carefully notice the wording of the messages and the placement of the spaces and colons. The program's output must match this. Sample Run 1: Enter a name: Isabella That was a popular name between 2000 and 2009. Sample Run 2: Enter a name: Voldemort That was not a popular name between 2000 and 2009.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Assume the file popular_names.txt contains the 400 most popular names given to children born in the United States from the year 2000 through 2009. The file contains 400 lines, with one name per line.
Write a Python program that reads the contents of the file into a list. The program should display the following string to prompt the user to enter a name:
'Entet a name: '
The program should then display a message indicating whether the name is among the most popular. If the name is found in the list, the program should display the following message:
'That was a popular name between 2000 and 2009.'
If the name is not found in the list, the program should display the following message:
'That was not a popular name between 2000 and 2009.'
Look carefully at the samples given. In the first example, the user enters a name that is found in the list. In the second example, the user enters a name that is not found in the list. Carefully notice the wording of the messages and the placement of the spaces and colons. The program's output must match this.
Sample Run 1:
Enter a name: Isabella
That was a popular name between 2000 and 2009.
Sample Run 2:
Enter a name: Voldemort
That was not a popular name between 2000 and 2009.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education