Goal of the script here for python

Assignment Help Basic Computer Science
Reference no: EM131835550

I need help with an assignment. The goal of the script here for Python is to make a program that lets users enter their information as long as they want. The information I need is sex, age, and name. Then I have to print the number of males/number of females and an average age. Finally, the user has to be able to exit the program. Additionally, there must be an exception for spelling male or female wrong and an exception for ages outside of the 18-65 range. This is what I have so far but loops, lists and exceptions is quite confusing.

name = " "

gender = " "

age = " "

maleVariable = []

femaleVariable = []

ageVariable = []

name = raw_input ("Enter name here or press enter to end script:")

while True:

   if name == "enter":

       break

   else:

       age = raw_input ("Enter age here:")

       gender = raw_input ("Enter gender here (male or female):")

   if gender == "male":

       maleCount == maleCount + 1

       MaleInfo.append ((name, age))

   if gender == "female":

       femaleCount = femaleCount + 1

       FemaleInfo.append ((name, age))

name = ""

list = [ ]

while name <> " ":

   name = raw_input ("What is your name: ")

age = ""

list = [ ]

while age <> " ":

   age = raw_input ("How old are you: ")

sex = ""

list = [ ]

while sex <> " ":

   sex = raw_input ("Are you a male or female: ")

for i in MaleInfo:

   print i[0] + " is " + i[1] + " year old."

for i in FemaleInfo:

   print i [0] + " is " + i [1] + "years old."

cont = 'y'

cont not in "yes or no"

print femaleCount

print femaleAge/femaleCount

print maleCount

print maleAge/maleCount

print "Loop completed"

maleVariable = []

femaleVariable = []

Reference no: EM131835550

Questions Cloud

What are the tools available and limitations : You have found out that your team is not familiar with the Active Directory Tools. What are the tools available and limitations.
Analyze the business-level strategies : Assess your satisfaction with the Aldi's and make recommendations about how that company could modify its business-level strategy to both increase.
How about the expected return to equity owners and rE : A firm requires $L to pay for a single project that it wants to invest in. How about the expected return to equity owners, rE,?
Evaluate the two evaluation instruments used in the fabrics : Evaluate the two evaluation instruments used in the Fabrics, Inc. case. Discuss how the evaluation results should be used.
Goal of the script here for python : I need help with an assignment. The goal of the script here for Python is to make a program that lets users enter their information as long as they want
To calculate the number of years until maturity : To calculate the number of years until maturity, assume that it is currently January 15, 2016. What is the coupon rate for the Williams Co. bond?
Discuss one of the foreign health care systems : Compare one of the foreign health care systems outlined in your text or in other sources, and point out the major differences with the health care system.
Retrieve details of all the students : Write SQL statement to retrieve details of all the students who have registered for the module 'CSE1016Y'. The details to be retrieved are the student id
Find problems inherent in simpson wacc calculation : Find problems inherent in Simpson’s WACC calculation. 2. What can you suggest to solve problems found in Question 1?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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