Skip to content

Commit 519dcdd

Browse files
6
1 parent e8af982 commit 519dcdd

File tree

3 files changed

+21
-917
lines changed

3 files changed

+21
-917
lines changed

6.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1+
import zipfile
2+
3+
z = zipfile.ZipFile("channel/channel.zip", "r")
4+
b = b""
5+
6+
17
def read_next(file_name):
8+
global z
9+
global b
10+
b += z.getinfo("{}.txt".format(file_name)).comment
211
f = open("channel/channel/{}.txt".format(file_name), "r")
312
lines = f.readlines()
413
for i in range(len(lines)):
514
s = lines[i]
6-
print(s)
715
ary = s.split()
816
result = ary[-1]
917
if result.isdigit():
1018
read_next(result)
1119
else:
1220
pass
1321

14-
15-
read_next(90052)
22+
read_next(90052)
23+
print(b.decode())

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# pythonchallenge
22
Solve Problems in http://www.pythonchallenge.com
33

4+
##### 6
5+
result: http://www.pythonchallenge.com/pc/def/oxygen.html
6+
```
7+
import zip
8+
```
9+
zip file not only can bi unzip, can contains a lot of comments.
10+
11+
412
#### 5
5-
http://www.pythonchallenge.com/pc/def/channel.html
13+
result: http://www.pythonchallenge.com/pc/def/channel.html
614
```
715
import pickle
816
```
917
every line elements add up to 96
1018

1119
#### 4
12-
http://www.pythonchallenge.com/pc/def/peak.html
20+
result: http://www.pythonchallenge.com/pc/def/peak.html
1321

1422
```
1523
import requests

0 commit comments

Comments
 (0)