Answers for "if string contains list of letters python"

2

python list contains substring

str_list = ["one", "two", "three"]
substr = "wo"
if any(substr in str for str in str_list):
	print('Yes!')
Posted by: Guest on September-01-2021
0

check if string contains alphabets python

import re
print(re.search('[a-zA-Z]', "anything"))
Posted by: Guest on April-23-2021
0

if string contains list of letters python

char_list = ["a", "b" ,"c"]
string = "abcd"

matched_list = [characters in char_list for characters in string]

print(matched_list)
Posted by: Guest on January-30-2022

Code answers related to "if string contains list of letters python"

Python Answers by Framework

Browse Popular Code Answers by Language