Question: (BoyNames.txt -GirlNames.txt ) Write a Python(3.5.2) program that reads the contents of the two files into two separate lists, allows a user to input either
(BoyNames.txt -GirlNames.txt )
Write a Python(3.5.2) program that reads the contents of the two files into two separate lists, allows a user to input either a girl's name, a boy's name, or both, then tells the user whether the name(s) was/were popular between 2000 and 2009. First, the program should prompt the user to choose a girl's name, a boy's name, or both by entering either 'girl', 'boy', or 'both.' Once they have chosen, they should be able to input a name. If the name was a popular name, like Jacob or Sophia, the program should print "Jacob was a popular boy's name between 2000 and 2009." or "Sophia was a popular girl's name between 2000 and 2009." If the name was not a popular name, like Voldemort, the program should print "Voldemort was not a popular boy's name between 2000 and 2009." If the user chooses to input both a girl and boy's name, ask for the boy's name, then the girl's name, and print two statements in the form mentioned above on two separate lines, with the statement about the boy's name coming first. For example, if the user inputs Voldemort and then Sophia, print: Voldemort was not a popular boy's name between 2000 and 2009. Sophia was a popular girl's name between 2000 and 2009. You should use at least two functions other than def main(): in your program. At least one of the functions should return a value to the calling function. The program is to use all of both lists, The criteria being if the use input is contained in the lists. The lists are popular names between 2000-2009. Correct reading of data from the text files into lists/arrays. There are many ways to do this, but you should read the data into lists before searching. Search of one or both arrays as indicated by the user to determine if a name input was popular between 2000-2009.
in python
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
