sort () and reverse() Methods in Python

preview_player
Показать описание
This video shows how to use sort() and reverse() methods in Python ...

Definition
The sort() method sorts the list ascending by default.
You can also make a function to decide the sorting criteria(s).
reverse Optional. reverse=True will sort the list descending. Default is reverse=False

Example Code
#using sort() and reverse() methods
list = ["Book","Apple","Dog","Camel"]
print(list)
Рекомендации по теме
visit shbcf.ru