This short Python tutorial shows how to sort integer and string lists in Python. A list is created as: example_list = [c, a, b] and can be sorted with following commands:
- sorted(example_list)
- example_list.sort()
To start with the biggest number or letter in the alphabet, we can use the argument; reverse=True within the sorted() function. To sort the letters regardless of lower- & uppercase, we can specify the key=str.lower within the sorted() function.
Many thanks for watching!
En esta página del sitio puede ver el video en línea Sorting integer and string lists in Python de Duración hora minuto segunda en buena calidad , que subió el usuario ExplainHowToSimply 17 octubre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,132 veces y le gustó 10 a los espectadores. Disfruta viendo!