{"id":311,"date":"2013-09-13T16:11:00","date_gmt":"2013-09-13T16:11:00","guid":{"rendered":"http:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-warming-up\/"},"modified":"2013-09-13T16:11:00","modified_gmt":"2013-09-13T16:11:00","slug":"the-python-challenge-warming-up","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-warming-up\/","title":{"rendered":"The Python Challenge &#8211; Warming Up"},"content":{"rendered":"<p>My nephew is doing <a href=\"http:\/\/www.pythonchallenge.com\/\">The Python Challenge <\/a>and my daughter has just started Python at school.\u00a0 I thought that it might be fun to have a play.\u00a0 I know nothing about python really, other than there are annoyingly two subtly different versions, version 2.x and 3.x<\/p>\n<p>So I thought I would have a play and try doing the challenge in both languages.<\/p>\n<p><a href=\"http:\/\/www.pythonchallenge.com\/pc\/def\/0.html\"><span>Warming Up<\/span> <\/a><\/p>\n<p>OK, so this looks like you need to replace the 0 in the URL (http:\/\/www.pythonchallenge.com\/pc\/def\/0.html) with 2 to the power of 38.\u00a0 Even I could do this I thought.\u00a0 It didn&#8217;t take long<\/p>\n<p>A quick google on how to launch the browser, and the small problem of changing a LONG in to a STRING and it was done.\u00a0 This works in both 2.7.5 and 3.0<\/p>\n<pre>import webbrowser<br>new = 2<br>warmingupurl = \"http:\/\/www.pythonchallenge.com\/pc\/def\/\" + str(2 ** 38) + \".html\"<br>webbrowser.open(warmingupurl,new=new)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>My nephew is doing The Python Challenge and my daughter has just started Python at school.\u00a0 I thought that it might be fun to have a play.\u00a0 I know nothing about python really, other than there are annoyingly two subtly different versions, version 2.x and 3.x So I thought I would have a play and &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2013\/09\/the-python-challenge-warming-up\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The Python Challenge &#8211; Warming Up<\/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":[1],"tags":[],"class_list":["post-311","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/311","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=311"}],"version-history":[{"count":0,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}