Move snippets in the correct folder

Related #188
This commit is contained in:
Angelos Chalaris
2020-03-15 12:54:08 +02:00
parent c3f3dc3e7e
commit 26772c3ee2
6 changed files with 0 additions and 0 deletions

21
snippets/includes_all.md Normal file
View File

@ -0,0 +1,21 @@
---
title: includes_all
tags: utility,intermediate
---
Returns `True` if all the elements in `values` are included in `lst`, `False` otherwise.
Check if every value in `values` is contained in `lst` using a `for` loop, returning `False` if any one value is not found, `True` otherwise.
```py
def includes_all(lst, values):
for v in values:
if v not in lst:
return False
return True
```
```py
includes_all([1, 2, 3, 4], [1, 4]) # True
includes_all([1, 2, 3, 4], [1, 5]) # False
```