Home > Python, PythonChallenge.Com > PythonChallenge – Level 5

PythonChallenge – Level 5


Homepagehttp://www.pythonchallenge.com/pc/def/peak.html

How I solve:

– I was totally clueless about this level. Why is that?

1) I’m new to Python, not knowing much about many common modules and function.

2) The level said that, “peak hell” and “pickle” sounds similar, well, who knows?

3) There is an Unix utility “banner” to create such a banner from ASCII character. Wow ..

Certainly, I’m damned, couldn’t solve this one.

– Searching Internet might help, and this is the solution that comes up with:

import pickle, urllib

handle = urllib.urlopen("http://www.pythonchallenge.com/pc/def/banner.p")
data = pickle.load(handle)
handle.close()

for elt in data:
    print "".join([e[1] * e[0] for e in elt])

– The code is from: http://holger.thoelking.name/python-challenge/all#level_5

– Anyway, it’s not so cool -_-;;

Cheers,
Pete Houston

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: