diff options
-rw-r--r-- | bot/resources/tags/loop-remove.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/resources/tags/loop-remove.md b/bot/resources/tags/loop-remove.md index 624af8bcb..6acc843fd 100644 --- a/bot/resources/tags/loop-remove.md +++ b/bot/resources/tags/loop-remove.md @@ -19,7 +19,7 @@ print(data) # [2, 4] <-- every OTHER item was removed! ^ # and so on... ``` You can avoid this pitfall by: -- using a list comprehension to produce a new list (as a way of filtering items): +- using a **list comprehension** to produce a new list (as a way of filtering items): ```py data = [x for x in data if x % 2 == 0] ``` @@ -28,4 +28,4 @@ You can avoid this pitfall by: while data: item = data.pop() ``` -- consider: you may not need to remove items in the first place! +- considering whether you need to remove items in the first place! |