Skip to content

Commit

Permalink
corrects indexing/slicing of nested list
Browse files Browse the repository at this point in the history
  • Loading branch information
skafdasschaf committed May 25, 2023
1 parent a2bcfc2 commit 3af8aea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ nested_list
Indexing and slicing also work for nested lists:

```python
nested_list[1]
nested_list[1][2]
nested_list[2][2:6]
nested_list[2]
nested_list[2][1]
nested_list[2][1:3]
```

Since lists are [objects](python3.qmd#object-oriented-programming), they may be manipulated by special functions called *methods*. Methods are called like functions, but refer to a given object. Thus, the syntax for calling a method is as follows:
Expand Down

0 comments on commit 3af8aea

Please sign in to comment.