Anonymous user
Execute a Markov algorithm: Difference between revisions
→{{header|Python}}
(→{{header|Python}}: Add stretch goal solution) |
|||
Line 154:
return [ (matchobj.group('pat'), matchobj.group('repl'), bool(matchobj.group('term')))
for matchobj in re.finditer(syntaxre, grammar)
if matchobj.
def replace(text, replacements):
|