Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5. The readline method reads text until an end of line symbol is encountered how

ID: 3697339 • Letter: 5

Question

5. The readline method reads text until an end of line symbol is encountered how is an end of line character represented? B. t C. 6. What is returned when the readline method reaches the end of the file? A. v B. t Programming Problems: 1. Write a program that lists the most popular names for the year you were born. Follow the following steps. (15 points) 1. Go to to the website http://www.ssa.gov/OACT/babynames/ 2. Next select scroll down and select the tab Popular Names By Birth Year. 3. Then enter your birth year, select under popularity top 100, and finally select Go. 4. Using your mouse select the entire table. 5. Copy using Ctrl C 6. Open word and select paste. 7. Next select the table and make sure the columns are not huge. 8. Then select convert Table to Text. 9. Choose Tab and Save. 10. Write a program that reads in the file and outputs two output files girlnames.txt and boynames.txt. Use the example in class as a reference. Verified By: Date Extra Credit: (1 point) Is your name in the top 100 names? Yes or No?

Explanation / Answer

f = open("babynames.txt",'r')
f1 = open("boynames.txt",'w')
f2 = open("girlnames.txt",'w')
for line in f.readlines():
line = line[0:-1]
line = line.split(' ')
f1.write(line[1]+' ')
f2.write(line[2]+' ')
f.close()
f1.close()
f2.close()
  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote