How do you check if a string contains multiple words in Python?

Use the any() to check for multiple substrings in a string Use a for loop to iterate through a list of substrings. Within the for loop, check if each substring is in the string using the in keyword syntax substring in string , and append the resulting boolean to a new list.

Sizin İçin Seçtik  How do you check if a list of strings contains a string in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *