519 B
519 B
title, tags
| title | tags |
|---|---|
| includes_all | list,intermediate |
Returns True if all the elements in values are included in lst, False otherwise.
- Check if every value in
valuesis contained inlstusing aforloop, returningFalseif any one value is not found,Trueotherwise.
def includes_all(lst, values):
for v in values:
if v not in lst:
return False
return True
includes_all([1, 2, 3, 4], [1, 4]) # True
includes_all([1, 2, 3, 4], [1, 5]) # False