-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5.py
32 lines (25 loc) · 773 Bytes
/
5.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
#!/usr/bin/bash
# Problem - http://www.pythonchallenge.com/pc/def/peak.html
# Thought Process -
# peak hell sounds familiar ? "peak hell" - "pickle"
# Source file gives <peakhell src="banner.p" />
# copy the html text in a file named banner.p
# .p is a pickled file in python
# opening banner.p gives a serialized object
# Solution - http://www.pythonchallenge.com/pc/def/channel.html
import pickle
# deserialize the object file
fileObject = open("banner.p", 'r')
b = pickle.load(fileObject)
# a multidimesional list of tuples gives an ascii art with channel as solution
sol = ""
for i in range(len(b)):
for j in range(len(b[i])):
item = b[i][j]
k = 0
while(k < item[1]):
sol += item[0]
k += 1
sol += "\n"
print(sol)
# Solution - channel