Created
December 18, 2017 12:46
-
-
Save Jayasagar/08494abaae73d42b3f75d2531697cfae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of users | |
list = ['Deli','Corn', 'Alice', 'Bob'] | |
# Length of the user list | |
print('List Length', len(list)) | |
# List slice | |
print(list[1:3]) ## ['Corn', 'Alice'] -> include element at index 1 and exclude elememnt at index 3 | |
# Sorting:: sort function doesn't return a value! But 'list' should have sorted. | |
list.sort() | |
print(list) | |
# Reverse | |
list.reverse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment