Sorting Lists In Python

Опубликовано: 08 Март 2021
на канале: Dubious Code
173
0

Sorting lists in Python is something that you will do all the time. A basic list sort can be done with a .sort(). You also have options to do a reverse sort, and to provide a key to sort by something other than the first element.

Since python sorts are stable, if you sort by item 2 and then item 1, item 2 will act as a tie breaker in the cases where the list would have equivalent item 1's


All code

Copyright 2021 Google LLC
SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICEN...

The Snake image in the thumbnail - by Vecteezy https://www.vecteezy.com/vector-art/4...


На этой странице сайта вы можете посмотреть видео онлайн Sorting Lists In Python длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Dubious Code 08 Март 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 173 раз и оно понравилось 0 зрителям. Приятного просмотра!