Python Challenge Level 1

A couple of days back, I tried started solving questions from Python Challenge. In all there are 33 levels. I’ve completed the first few levels and I plan to blog about them. This is one is about how I solved the first level. Pull up a terminal and type, “python”. You get an interactive shell. Just type 2**38 and you get  the answer.

savita@Amrita:~/python_challenge$ python
Python 2.7.3 (default, Aug  1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 2**38

Now following what the hint suggests, change the URL. The original URL is : . I tried changing that to : . As a result, I got this message : “the L in unnecessary”.  So I removed the L from the URL, and bingo !!! I got to the next level. This is the simplest way of doing it. You could even resort to scripting the command in a file and then executing the file. There are also ways of doing it.

Another way of solving this level is :

>>>pow(2, 38)

You could start too 🙂


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s