import re def letter_and_two_digits(text) -> bool: if re.search("[A-Z]\d{2}", text): return True else: return False