What are the total number of babies born in texas

Assignment Help Computer Engineering
Reference no: EM132112816

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.

Reference no: EM132112816

Questions Cloud

Foreign direct investment and comparative advantage : Is there a relationship between foreign direct investment and comparative advantage? What is it and Why would that be so?
Briefly summarize the arguments of warren buffett : Briefly summarize the arguments of Warren Buffett and Greg Mankiw with respect to the U.S. trade deficit. Who is right in your opinion?
What is the elasticity of demand : They sold 500,000 units (30-day supplies) that year. In 2016, they experimented with lowering the price to $15 per 30-day supply.
Write a progra m that creates two objects : Write a progra m that creates two objects, object of the ProductionWorker class and an object of ShiftSupervisor r class.
What are the total number of babies born in texas : What are the total number of babies born in Texas in 2012? What are the total number of babies born in Texas with your name since 1910?
Human factor in network designing and analysis : BN321 - Advanced Network Design - Human Factor in Network Designing and Analysis - Apply concepts and theories of human factors as related to network design
Equipment to agree to a voluntary export restraint agreement : Congress could impose a specific tariff or persuade foreign producers of agricultural equipment to agree to a voluntary export restraint agreement.
Write a function named twowords that gets and returns : This problem provides practice using a while True loop. Write a function named twoWords that gets and returns two words from a user.
Understanding of price elasticity of demand : If you owned a business, how will you apply your understanding of price elasticity of demand in your pricing policy?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Why is it important to bring standalone systems into domain

Why is it important to bring standalone systems into the Domain? What was the command line syntax to connect as the root user to 172.30.0.11 using PuTTY?

  Develop implementation plan that captures testing activities

Develop a detailed implementation plan that captures Testing activities. Required resources to support these activities.

  Is data brokerage ethical

double-spaced statement analyzing the data brokerage phenomenon. Is data brokerage ethical. Do the benefits brought to consumers outweigh the downsides

  Write a program that simulates shuffling and dealing

Ask the user how many cards to deal per hand, and how many players Chands to deal. Example output How many cards per hand?

  Which is true of today''s cios

The traditional set of IS responsibilities includes all of the following except.

  Design low fidelity mock-up prototypes for phone and kiosk

Determined technical and human interaction requirements for both kiosk and smart phone. Designed low fidelity mock-up prototypes for both the phone and kiosk.

  Complete the specification of the elevator system

Complete the specification of the elevator system given in by describing the opening and closing of the doors.

  Describe how the five types of ai systems differ

Explain how the Internet and the World Wide Web have evolved over the years and disrupted traditional ways of doing business. ??

  Write an awk script to display the phone number

Write an awk script called activity6.1-6.awk to display the phone number of the user whose username is assigned to the variable user at the command line.

  Develop a product service idea

After reviewing the assigned reading materials, complete the following activities: Describe the product/service including the benefits of using the product.

  What happens if you try to open a file for writing

What happens if you try to open a file for writing, but the file or device is write protected (sometime called read-only)? Try it out with a short test program.

  Discuss the dangers of the given internet

Describe the reasons for having a totally anonymous means of accessing the internet. Please also discuss the dangers of that same internet. Minimum 250 words.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd