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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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