Skip to content

Instantly share code, notes, and snippets.

@fforbeck
Created May 30, 2012 16:04
Show Gist options
  • Save fforbeck/2837262 to your computer and use it in GitHub Desktop.
Save fforbeck/2837262 to your computer and use it in GitHub Desktop.
pc_03
import re
import itertools
especial_letters = set()
in_file = open('pc_03.txt', "rt")
while True:
line = in_file.readline()
if not line:
break
match = re.search('[A-Z]{3}[a-z]{1}[A-Z]{3}', line)
if match is not None:
especial_letters.add(match.group()[3])
in_file.close()
print(''.join(sorted(especial_letters)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment