Last active
December 12, 2015 12:38
-
-
Save christianroman/4772868 to your computer and use it in GitHub Desktop.
SGCODE 12 Febrero
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lines, out = [line.strip() for line in open('data.in')], '' | |
for x in xrange(1, int(lines[0])+1): | |
l = lines[x].upper() | |
import re | |
for w in l.split(' '): | |
m = re.search('^h.+o|^p.*r$', w, re.IGNORECASE) | |
l = l.replace(w, "#" * w.__len__()) if m and m.groups() > 0 else l | |
out += l + "\n" | |
with open ('data.out', 'w') as f: f.write (out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment