Home / Python Tips Generated By ChatGPT / Using sorted() for Sorting Iterables in Python Sort lists or other iterables with sorted(). Source Code print(sorted([3, 1, 4, 1, 5, 9, 2]))