mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 15:24:09 +03:00
Merge pull request #17 from mrshankly/patch-1
Corrected the last element of li in the lists explanation
This commit is contained in:
commit
63b8f04c57
@ -122,7 +122,7 @@ li.append(3) # li is now [1, 2, 4, 3] again.
|
|||||||
# Access a list like you would any array
|
# Access a list like you would any array
|
||||||
li[0] #=> 1
|
li[0] #=> 1
|
||||||
# Look at the last element
|
# Look at the last element
|
||||||
li[-1] #=> 4
|
li[-1] #=> 3
|
||||||
|
|
||||||
# Looking out of bounds is an IndexError
|
# Looking out of bounds is an IndexError
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user