Challenge 3

Well, it said EXACTLY three big bodyguard, so the first try is like this:
import re
target = re.compile(r”[!A-Z][A-Z]{3}([a-z])[A-Z]{3}[!A-Z]”)
f = open(”mess.txt”, “r”)
myout = target.findall(f.read())
And I got this:
In [7]: print myout
[’e’, ‘i’, ‘z’, ‘r’, ‘v’, ‘g’, ‘b’, ‘m’, ’s’, ‘z’, ‘u’, ‘o’, ‘w’, ‘i’, ‘b’, ‘z’, ‘b’, ‘c’, ‘j’, ‘g’, ‘d’, ‘o’, ‘h’, ‘l’, ‘
z’, ‘x’, ‘j’, ‘v’, […]

Close
E-mail It