new_list = sorted(a_list, key=lambda x: (len(x), x))