-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6.py
36 lines (26 loc) · 959 Bytes
/
6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
# Problem - http://www.pythonchallenge.com/pc/def/channel.html
# Thought Process - zip is written, download channel.zip
# also there is a zip in the image
# http://www.pythonchallenge.com/pc/def/channel.zip
# extract zip
# zip contains files with name to next file
# the last file says collect comments, there is properties associated with each file, we hbave to collect it
# Solution - http://www.pythonchallenge.com/pc/def/oxygen.html
import zipfile
f = zipfile.ZipFile("channel.zip")
foo = "90052"
comments = []
while(True):
bar = f.read(foo + ".txt", 'r').decode("utf-8")
comments.append(f.getinfo(foo + ".txt").comment.decode("utf-8"))
print(bar)
etc = bar.split()[-1]
if etc != "comments.":
foo = bar.split()[-1]
print(foo)
else:
break
print("".join(comments))
# solution - hockey
# going to hockey it says - "it's in the air. look at the letters."# looking at the letters of ASCII arts we get oxygen