What am I doing wrong? I am to take the average number of each cooled, heated, regular and either subtract the degrees below 60(heated) or above 80(cooled),then add that number to the number of days
# Chpt 8#11Tempdays.py
# A program to add a set of temperatures enter by the user
# and determine the number of cooled days and heated days

def main():
sum = 0
#number of days
count = 0
#average daily temperature
xStr = raw_input("Enter a Temperature (999 to quit)>> ")
while xStr != 999:
x = eval(xStr)
sum = sum + x
count = count + 1
aver = int(sum/count)
# cooling days
if aver > 80:
count1 = count1 + 1
a = abs(80-aver)
y = a + count

#heating days
elif aver < 60:
count2 = count2 + 1
b = abs(60-aver)
count2 = count2 + 1
b = b + count2
#regular days

c = count
xStr = raw_input("Enter a number (999 to quit) >> ")

print "The number of the days is",c,
print "The number of cooled days are", y,
print "The number of heated days are",b,

( .16)
Also How do I get ( A ) in python language? (that is A exponent .16 .?)

9 Years
Discussion Span
Last Post by liz517

Thank-you. I am new to programming. This is my first course and I'm taking it on-line. I'm having a few problems, so any help I can get I appreciate. Do I need to post again, My indentions were correct.


thank-you I got it. This time. YOu know those road blocks.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.