0
how to check if there is "A1" sequence somwhere in string?
e.g: if string = "A1BBD5" then it should return True else False because ithas "A1" or if string = "BOOEZP4HTIN3G3WMLQ1M7FMB" it should return False because there is no "A1".
1 Answer
+ 2
string = âA1BBD5â
pattern = âA1â
if pattern in string:
print(âFound it!â)
or simple
print(pattern in string)
or as a function
def check(string, pattern):
return pattern in string