Okay So I barely started class a few days ago and everything is new to me. What I am suppose to be doing is creating something that will convert Celsius temps into Fahrenheit and also Kelvin, I've done that although it is a bit sloppy.
Anyways my issue is with the accumulator. when i total up the sum of all the Celsius degrees i get 231 when it should be 210. It added the 21 i had from "While celsius < 21.
Can anyone help me figure out how to get the correct number :/? Thanks!
print ("Celsius Conversion Chart")
sum = 0
sum1 = 0
sum2 = 0
celsius = 0
while celsius < 21:
print (str(celsius)+'°C ' + ' = ' + str(celsius*9/5+32)+'°F ' + ' = ' + str(celsius +273.15)+'°K')
celsius += 1
sum = sum + celsius
sum1 = sum1 + (celsius * 9/5 + 32)
sum2= sum2 + (celsius + 273.15)
print (str(sum1)+'°F')
print (str(sum2)+'°K')
print (str(sum)+'°C')
if celsius < 100:
print ("WARNING: temperature is too high")