Prepare repository for merge

This commit is contained in:
Angelos Chalaris
2023-05-01 22:43:50 +03:00
parent ab1ea476c5
commit a5ca5190e5
169 changed files with 0 additions and 626 deletions

View File

@ -0,0 +1,25 @@
---
title: List includes all values
type: snippet
tags: [list]
cover: switzerland-night
dateModified: 2020-11-02T19:28:05+02:00
---
Checks if all the elements in `values` are included in `lst`.
- Check if every value in `values` is contained in `lst` using a `for` loop.
- Return `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
```