Skip to content

Instantly share code, notes, and snippets.

@SushmaBaliza
Last active June 3, 2020 15:40
Show Gist options
  • Save SushmaBaliza/d666e59e0b13d4e3038e20b42fde9b60 to your computer and use it in GitHub Desktop.
Save SushmaBaliza/d666e59e0b13d4e3038e20b42fde9b60 to your computer and use it in GitHub Desktop.
list_1 = ['c', 'o', 'd', 'e', 'r', 'e', 'f', 'e', 'r']
# Return only 3rd,4th,5th items of list.
print(list_1[2:5])
# Return values from 6th item to last item of list
print(list_1[5:])
# Return values from first item of list to 4th element
print(list_1[:3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment