Wat are the total number of babies born in texas in 2012


Python: I need help writing a code that reads a text file then answers the following questions:

1. How many girl babies have been born since 1910?

2. How many boy babies have been born since 1910?

3. How many girl babies were born 1910? In 2012?

4. How many boy babies were born in 1910? In 2012?

5. What are the total number of babies born in Texas in 2012?

6. What are the total number of babies born in Texas with your name since 1910?

7. What are the total number of babies born in Texas with your name between 1910 and 1960? If you have a very uncommon name, feel free to pick any name that you might be curious about.

8. What name was the most popular (had the highest count in one year): * For males * For females

9. What name was that? * For males * For females

10. What year was that? * For males * For females

11. In what year was your name the most popular (had the highest count)?

THIS IS MY CODE:

text_file = open("TXBabyNames.txt", "r")
lines = text_file.readlines()
print lines
print len(lines)
text_file.close()

def check():
datafile = file('TXBabyNames.txt')
found = False
for line in datafile:
if 1910 in line:
found = True
break

return found

found = count()
if found:
print lines
else:

The Text File is a list of years with names.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Wat are the total number of babies born in texas in 2012
Reference No:- TGS02906270

Expected delivery within 24 Hours