# find the maximum score sentinel = -999 # an unexpected score value maximum = sentinel # signifies that maximum is not yet set while True: print("Enter a score [", sentinel, "to exit]: ") aScore = int(input()) # see 5.1 if aScore == sentinel: break # that's the signal to exit this loop if maximum == sentinel or maximum < aScore: maximum = aScore # find the minimum score sentinel = -999 # an unexpected score value minimum = sentinel # signifies that maximum is not yet set while True: print("Enter a score [", sentinel, "to exit]: ") aScore = int(input()) # see 5.1 if aScore == sentinel: break # that's the signal to exit this loop if minimum == sentinel or minimum > aScore: minimum = aScore # find the maximum and minimum scores sentinel = -999 # an unexpected score value maximum = sentinel # signifies that maximum is not yet set minimum = sentinel # signifies that maximum is not yet set while True: print("Enter a score [", sentinel, "to exit]: ") aScore = int(input()) # see 5.1 if aScore == sentinel: break # that's the signal to exit this loop if maximum == sentinel or maximum < aScore: maximum = aScore if minimum == sentinel or minimum > aScore: minimum = aScore