sorted()
numbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
sorted_numbers = sorted(numbers)
print(sorted_numbers) # Выведет: [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]text = "python"
sorted_text = sorted(text)
print(sorted_text) # Выведет: ['h', 'n', 'o', 'p', 't', 'y']words = ["banana", "apple", "cherry"]
sorted_words = sorted(words, key=len)
print(sorted_words) # Выведет: ['apple', 'banana', 'cherry']Последнее обновление