new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
9
Task/Arrays/Python/arrays-6.py
Normal file
9
Task/Arrays/Python/arrays-6.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Retrieve an element directly from the array.
|
||||
item = array[index]
|
||||
|
||||
# Use the array like a stack. Note that using the pop() method removes the element.
|
||||
array.pop() # Pop last item in a list
|
||||
array.pop(0) # Pop first item in a list
|
||||
|
||||
# Using a negative element counts from the end of the list.
|
||||
item = array[-1] # Retrieve last element in a list.
|
||||
Loading…
Add table
Add a link
Reference in a new issue