from random import shuffle def is_in_order(x): """prec: x is a homogeneous list of sortable items post: returns true if the list is in ascending order.""" k = 0 while k < len(x) -1: if x[k] > x[k+1]: return False k += 1 return True def bozo(x): while not is_in_order(x): shuffle(x) x = [3,-2, 5, 7, 9, -10, 6, 1, 2] bozo(x) print(x)