5 lines
242 B
Python
5 lines
242 B
Python
import re
|
|
|
|
def natural_sort_key(s):
|
|
"""Функция для получения ключа для натуральной сортировки."""
|
|
return [int(text) if text.isdigit() else text.lower() for text in re.split(r'(\d+)', s)] |