{"id":306,"date":"2013-09-24T21:03:00","date_gmt":"2013-09-24T21:03:00","guid":{"rendered":"http:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-5\/"},"modified":"2013-09-24T21:03:00","modified_gmt":"2013-09-24T21:03:00","slug":"the-python-challenge-5","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-5\/","title":{"rendered":"The Python Challenge &#8211; 5"},"content":{"rendered":"<p>A bit annoyed about this one.\u00a0 The Peak Hell clue was completely lost on me and in searching I came across another blog that had all the solutions.\u00a0 I got sucked in and saw what the end game was.\u00a0 I guess I would have worked it out pretty quickly anyway.<\/p>\n<p>The banner.p name gave it away too I guess. Serialization the python way was easy\u00a0 enough.<\/p>\n<h3>2.7 Solution<\/h3>\n<pre>#pickle?<br>import pickle<br>data = pickle.load( open( \"banner.p\", \"rb\" ) )<br><br>mycount = 0<br><br>for line in data:<br>    myline = \"\"<br>    for item in line:<br>        counter = 0<br>        mycount = int(item[1])<br>        while counter             myline += item[0]<br>            counter += 1<br>    print myline<\/pre>\n<h3>3.2.3 Solution\u00a0 <\/h3>\n<pre>#pickle?<br>import pickle<br>data = pickle.load( open( \"banner.p\", \"rb\" ) )<br><br>mycount = 0<br><br>for line in data:<br>    myline = \"\"<br>    for item in line:<br>        counter = 0<br>        mycount = int(item[1])<br>        while counter             myline += item[0]<br>            counter += 1<br>    print (myline)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A bit annoyed about this one.\u00a0 The Peak Hell clue was completely lost on me and in searching I came across another blog that had all the solutions.\u00a0 I got sucked in and saw what the end game was.\u00a0 I guess I would have worked it out pretty quickly anyway. The banner.p name gave it &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-5\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The Python Challenge &#8211; 5<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[39],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","tag-python"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":0,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}