diff --git a/snippets/is_contained_in.md b/snippets/is_contained_in.md index 93550ddf9..1491bcb65 100644 --- a/snippets/is_contained_in.md +++ b/snippets/is_contained_in.md @@ -3,9 +3,11 @@ title: is_contained_in 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 def is_contained_in(a, b): diff --git a/snippets/map_object.md b/snippets/map_object.md index 5eebb5843..57eae334d 100644 --- a/snippets/map_object.md +++ b/snippets/map_object.md @@ -3,7 +3,8 @@ title: map_object 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.