Sunday, August 3, 2014

python challenge solution level 3

http://www.pythonchallenge.com/pc/def/equality.html


One small letter, surrounded by EXACTLY three big bodyguards on each of its sides.



1) Go to the source of page:
view-source:http://www.pythonchallenge.com/pc/def/equality.html

2) copy the text in comment <!-- ............text.......... -->

3) Python code for the answer:

str1 = '''copied_text_in_step2'''  #multiline text as the text is huge

import re

print "".join(re.findall('[a-z][A-Z]{3}([a-z])[A-Z]{3}[a-z]', str1))

------------------

output = linkedlist



Link to go to next challenge = http://www.pythonchallenge.com/pc/def/linkedlist.html
> linkedlist.php

Final link = http://www.pythonchallenge.com/pc/def/linkedlist.php







No comments:

Post a Comment