level5
地址:http://www.pythonchallenge.com/pc/def/peak.html。
源码:git@code.aliyun.com:qianlizhixing12/PythonChallenge.git。
问题:使用pickle对象观察打印。
#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
# Level 5
import urllib.request
url = "http://www.pythonchallenge.com/pc/def/banner.p"
response = urllib.request.urlopen(url)
body = response.read()
response.close
import pickle
obj = pickle.loads(body)
for subobj in obj:
for (x, y) in subobj:
print(x * y, end="")
print("\n")