In <[email protected]> Jake Kobs <[email protected]> writes:
> Here is the code: > def getHigh(pints, highPints): > highPints = pints[0] > counter = 1 > while counter < 7: > if (pints[counter] > highPints): > highPints = pints[counter] > counter = counter + 1 > return highPints getHigh() goes into an infinite loop if pints[counter] is less than or equal to highPints. > def getLow(pints, lowPints): > lowPints = pints[0] > counter = 1 > while counter < 7: > if (pints[counter] < lowPints): > lowPints = pints[counter] > counter = counter + 1 > return lowPints And getLow() has a very similar problem. I suspect you want to unindent the 'counter = counter + 1' statement so that it is NOT inside the 'if' statement. -- John Gordon A is for Amy, who fell down the stairs [email protected] B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list
