sort mixed values fixed with str
mixed = [100, 'foo', 42, 'bar']
print(mixed)
mixed.sort(key=str)
print(mixed)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
mixed = [100, 'foo', 42, 'bar']
print(mixed)
mixed.sort(key=str)
print(mixed)