Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update list-comprehension.md
  • Loading branch information
myckellr authored Nov 28, 2021
commit 2258e97fc66fa9a304a0a1dd05a14acbe32ee718
2 changes: 1 addition & 1 deletion basics/list-comprehension.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ print(arr)
The example above shows a list of animals and the for loop iterates through the list of animals and the if statement filters the list and only adds the animal if their name is exactly 3 characters long.

## With List Comprehension
```
```python
animals = ["dog", "cat", "giraffe", "donkey", "ape"]

arr = [i for i in animals if len(i) == 3]
Expand Down