Apply suggestions from code review
Co-Authored-By: Angelos Chalaris <chalarangelo@gmail.com>
This commit is contained in:
committed by
GitHub
parent
53c0329a89
commit
223785a49f
@ -14,5 +14,5 @@ def for_each(itr, fn):
|
||||
```
|
||||
|
||||
```py
|
||||
for_each([1, 2, 3], print) # 1 2 3
|
||||
for_each([1, 2, 3], print) # 1 2 3
|
||||
```
|
||||
|
||||
@ -14,5 +14,5 @@ def for_each_right(itr, fn):
|
||||
```
|
||||
|
||||
```py
|
||||
for_each_right([1, 2, 3], print) # 3 2 1
|
||||
for_each_right([1, 2, 3], print) # 3 2 1
|
||||
```
|
||||
|
||||
@ -5,8 +5,8 @@ tags: list,intermediate
|
||||
|
||||
Returns `True` if two lists contain the same elements regardless of order, `False` otherwise.
|
||||
|
||||
Use `set()` on combination of both lists to find the unique values.
|
||||
Iterate over them with a `for` loop comparing the `count()` of each unique value in each array.
|
||||
Use `set()` on the combination of both lists to find the unique values.
|
||||
Iterate over them with a `for` loop comparing the `count()` of each unique value in each list.
|
||||
Return `False` if the counts do not match for any element, `True` otherwise.
|
||||
|
||||
```py
|
||||
|
||||
@ -3,7 +3,7 @@ title: includes_any
|
||||
tags: list,intermediate
|
||||
---
|
||||
|
||||
Returns `True` if any the elements in `values` are included in `lst`, `False` otherwise.
|
||||
Returns `True` if any element in `values` is included in `lst`, `False` otherwise.
|
||||
|
||||
Check if any value in `values` is contained in `lst` using a `for` loop, returning `True` if any one value is found, `False` otherwise.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user