totalTemp = 0 #initialise total of Temperatures numberOfTemps = 0 #initialise number of temperatures print ("Enter next temperature ") temp = int(input()) #input first temperature while temp !=-100: totalTemp = totalTemp + temp numberOfTemps = numberOfTemps + 1 print("Enter next temperature") temp = int(input()) if numberOfTemps == 0: print("No valid temperatures entered - program terminated") else: averageTemp = totalTemp/numberOfTemps print ("average temp = ", averageTemp)