Skip to content

Instantly share code, notes, and snippets.

@Robofied
Last active February 5, 2019 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robofied/9884fcd658de65b4d148aa5b872d0f69 to your computer and use it in GitHub Desktop.
Save Robofied/9884fcd658de65b4d148aa5b872d0f69 to your computer and use it in GitHub Desktop.
## pop() method
l4.pop(5)
print(l4)
#[Output]:
#[1, 2, 3, 2, 3, 4, 5, 6, 7, [1, 2], 'a', 1, 'hello']
l4.pop()
print(l4)
#[Output]:
#[1, 2, 3, 2, 3, 4, 5, 6, 7, [1, 2], 'a', 1]
##del() method
del l4[3:5]
print(l4)
#[Output]:
#[1, 2, 3, 4, 5, 6, 7, [1, 2], 'a', 1]
##remove() method
l4.remove(1)
print(l4)
#[Output]:
[2, 3, 4, 5, 6, 7, [1, 2], 'a', 1]
##clear() method
l2.clear()
print(l2)
#[Output]:
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment