Hi everyone. I just need to know why this programs tells me End is not defined,
what can I o to fix this issue? Thanks in advance.
hrList=[]
while True:
heartrate= float(input('Enter heart rate as beats per min: '))
hrList.append(heartrate)
if heartrate=='End':
print '\nT
How can I calculate the average of a list of numbers (eg [2,5,8,7,3] ) and then
subtract the avg from the original numbers in the list and print?
Also, if I have a nested list:
sick_patients=[['Sam', 'M', 65, 'chest pain', 101.6], [['Sarah', 'F', 73,
'dizziness', 98.6], [['Susie', 'F', 34, 'he
How can I fix this loop so that it multiplies the two intergers and if user
types in 'quit' for either number it stops? if not it keeps going.
def multiply_integers(int1,int2):
print int1*int2
int1=float(input('Please enter 1st integer: '))
int2=float(input('Please enter 2nd integer: '))
I have two questions on these simple programs:
1st why does this loop keep repeating after I enter 'Quit'?
import calendar
m = raw_input(“Enter a year: “)
while m != “Quit”:
if calendar.isleap(int(m)):
print “%d is a leap year” % (int(m))
else:
print “%d is not a leap year” % (int(m))
2n
Hello everyone. How can I get a program to stop only when the user enters
'Quit'?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
From: Tutor [tutor-bounces+ysoliman=uncc@python.org] on behalf of Mark
Lawrence [breamore...@yahoo.co.uk]
Sent: Tuesday, March 12, 2013 10:29 PM
To: tutor@python.org
Subject: Re: [Tutor] BMI calc
On 13/03/2013 02:08, Dave Angel wrote:
> On 03/12/2013
Hello all,
I'm new to python and its been a stuggle so far. I'm attempting to create a BMI
calculator in Wing 101 4.1. I keep getting syntax errors:
def calc_BMI(weight,height):
return (weight/(height*height))*703.0
if bmi <=18.5:
print 'underweight'
elif bmi >= 18.5 and bmi <=24.9: