jfz-2023-s474155/TaskE09/run.py
2023-12-09 17:11:00 +01:00

20 lines
481 B
Python

import re
import sys
def isCapAnd2Digirts(s):
pattern = re.compile(r'.*[A-Z]\d{2}.*')
return bool(re.match(pattern, s))
inFile = sys.argv[1]
outFile = sys.argv[2]
# inFile = 'test.in'
# outFile = 'test.out'
with open(inFile, 'r', encoding='utf-8') as inputFile, open(outFile, 'w', encoding='utf-8') as outputFile:
for line in inputFile:
line = line.strip()
result = "yes" if isCapAnd2Digirts(line) else "no"
outputFile.write(result + '\n')