Given the string, s, and the list, lst, associate the variable contains with True if every string in lst appears in s (and False otherwise). Thus, given the string Hello world and the list ["H", "wor", "o w"], contains would be associated with True.
1
Expert's answer
2019-03-15T02:58:43-0400
# given string
s = "Hello world"
# and list
lst = ["H", "wor", "o w"]
# check if every item in list appears in string
contains = all(item in s for item in lst)
# print result (True/False)
print(contains)
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment