Apply suggestions from code review

Co-Authored-By: Isabelle Viktoria Maciohsek <maciv@hotmail.gr>
This commit is contained in:
Angelos Chalaris
2020-03-16 22:00:46 +02:00
committed by GitHub
parent d5878dbb14
commit 82d99f98cb
2 changed files with 6 additions and 3 deletions

View File

@ -3,9 +3,11 @@ title: is_contained_in
tags: list,intermediate tags: list,intermediate
--- ---
Returns `True` if the elements of the first λιστ are contained in the second one regardless of order, `False` otherwise. Returns `True` if the elements of the first list are contained in the second one regardless of order, `False` otherwise.
Use `count()` to check if any value in `a` has more occurences than it has in `b`, returning `False` if any such value is found, `True` otherwise.
Use `count()` to check if any value in `a` has more occurences than it has in `b`, returing `False` if any such value is found, `True` otherwise.
```py ```py
def is_contained_in(a, b): def is_contained_in(a, b):

View File

@ -3,7 +3,8 @@ title: map_object
tags: list,intermediate tags: list,intermediate
--- ---
Maps the values of a list to a dictionary using a function, where the key-value pairs consist of the value as the key and the mapped value. Maps the values of a list to a dictionary using a function, where the key-value pairs consist of the original value as the key and the result of the function as the value.
Use a `for` loop to iterate over the list's values, assigning the values produced by `fn` to each key of the dictionary. Use a `for` loop to iterate over the list's values, assigning the values produced by `fn` to each key of the dictionary.