I'm so close to figuring this thing out, but I must be looking right past the solution. This program is meant to receive temperature values in Celsius, convert them to Fahrenheit, and then count the number of "cool", "warm", and "hot" days. I've got the first two parts of this problem figured out, but for whatever reason, my program isn't counting the number of each kind of day correctly.
temperature_list = []
value = int(input("Number of temperatures to enter: "))
for i in range(value):
#We now collect the values
t = int(input("Enter temperature: "))
temperature_list.append(t)
print("Your entered temperatures in Celsius are: ", temperature_list)
#Next up is to print those temperatures in Fahrenheit, which we'll do in a batch
f_list = list()
f = [t*1.8 + 32 for t in temperature_list]
f_list.append(f)
fint = int(f[0])
cooldays = 0
hotdays = 0
for f in f_list:
if fint > 65 :
cooldays = cooldays + 1
if fint < 80 :
hotdays = hotdays + 1
print("Your temperature in Fahrenheit is: ", f[:])
warmdays = (len(f_list) - (cooldays + hotdays))
print(cooldays)
print(hotdays)
print(warmdays)
Can someone tell me what I'm missing, here?
fintin your loop for your conditionals when you should probably useint(f)cooldaysandhotdaysto occur in the same day, making your warmdays not valid