Wednesday, August 6, 2014

Python Challenge Level 6 Solution

Problem = http://www.pythonchallenge.com/pc/def/channel.html


Solution = http://www.pythonchallenge.com/pc/def/oxygen.html
Code = https://github.com/dkuldeep11/python-challenge/tree/master/challenge-6
Explanation ::


1) Extract the file, and read README.txt
2) It says start with 90052
3) Read the file and you get the new id, and so on...
4) Automate the above process in Python so that you get the final file in which there is no ID but the answer text
5) You get the answer as: "Collect the comments."
6) This was completely new thing for me to learn. Actually it is about the ZIP concept. Whenever we make a ZIP archive, lot of information is associated with every member of archive e.g. original_size, compress_size, date, comment, etc.
7) So what "Collect the comments." means is we are supposed to extract the comment part of each member of the given ZIP file
8) We get the various characters like " ", "*", "O", "X", "Y", "\n", ....
9) Again a new riddle :) But this was simple. Just join them as a string and print it. We get:


10) Happy !!! hold on... just try http://www.pythonchallenge.com/pc/def/hockey.html , it gives you 1 more step :P
"it's in the air. look at the letters."
11) If we look at the letters, we have: O, X, Y, G, E, N  => oxygen :) finally it works.


TAKE AWAY:  zipfile module




No comments:

Post a Comment