This is the assignment: #Write another program that prompts for a list of numbers as above and at the end prints out both the maximum and minimum of the numbers instead of the average.
def program2(): sum=0.0 count=1 greatest_so_far=None smallest_so_far=None while True: number=input("Please write a number. When you are done, please write 'done.'\n") if number=="done": break try: number=float(number) sum=sum+number count=count+1 if number==None or number>greatest_so_far: greatest_so_far=number elif number==None or number<greatest_so_far: smallest_so_far=number except: print("Please use only numbers.") #Why doesn't it work when I write "continue" here? print(sum,count,greatest_so_far,smallest_so_far) program2()