Skip to content

Instantly share code, notes, and snippets.

@omarjcero
Created August 13, 2021 16:51
Show Gist options
  • Save omarjcero/9c4f255f14899bdefbe72507d836a85d to your computer and use it in GitHub Desktop.
Save omarjcero/9c4f255f14899bdefbe72507d836a85d to your computer and use it in GitHub Desktop.
a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13]
print(a[1:]) # [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
print(a[-1]) # [13]
print(a[-4:]) # [10, 11, 12, 13]
print(a[1:-4]) # [1, 2, 3, 4, 5, 6, 7, 8, 9]
print(a[1:10]) # [1, 2, 3, 4, 5, 6, 7, 8, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment