Python Challenge
August 11, 2005 2:44 PM   Subscribe

Looking to learn that awesome programming language but lack the drive? Take the challange!
posted by Mach5 (40 comments total) 2 users marked this as a favorite
 
How the challenge works: use the clue given in each page to discover the URL for the next page. A 404 means you've gotten it wrong. If you're wrong but only by a little you may get a hint.

If you're an idiot like me, you may think that there's a problem on each of the pages from 0.html to 33.html. That is not the case.
posted by breath at 2:58 PM on August 11, 2005


And no sneaky brute-forcing!
posted by Mach5 at 2:59 PM on August 11, 2005


Unless your brute-forcer is written in Python, eh?
posted by breath at 3:04 PM on August 11, 2005


It's cool that www.pythonchallange.com goes to www.pythonchallenge.com.
posted by wilberforce at 3:05 PM on August 11, 2005


It's almost like the dudes behind the site realize that people like Mach5 can't spell.
posted by Kwantsar at 3:28 PM on August 11, 2005


Made it to level 2, but have no idea what to do with the gibberish in the page source. Looks like a binary viewed in a text editor ;)

I'm guessing that viewing the solution for level 1 might give a clue to solving this, but how the heck does one run python code? In a broswer? In a shell?
posted by starscream at 3:48 PM on August 11, 2005


And yes, I did translate level 1 by hand ;)
posted by starscream at 3:50 PM on August 11, 2005


as did I...this seems like a hell of a lot of fun.
posted by plexiwatt at 3:56 PM on August 11, 2005


See, I thought this was supposed to be a joke, because (a) who really wants to learn Python, and (b) CHALLANGE!
I thought we were going to get to make fun of people who can't spell. Alas. Maybe I should try the actual challenge.
posted by blacklite at 3:58 PM on August 11, 2005 [1 favorite]


I refuse to translate level 1 by hand. And I refuse to learn python just to make it to the next level too.
posted by antifuse at 3:59 PM on August 11, 2005


I started using Python last year for a project I'm involved in and was immediately impressed by its elegance and simplicity. It quickly became one of my favourite programming languages ever.

Thanks for the link, this is going to keep me entertained for a while.
posted by Goblindegook at 4:22 PM on August 11, 2005


I opened notepad for level 1, is that still by hand? Anyway, I got to level 3 and that was it -- also, I used perl, because I am using perl lately a lot anyway, and up to and including level 3 there's nothing but some string searching. wow, python lets me search strings for special sequences!

anyway, yeah. I am cynical. I'm sure python's lovely.
posted by blacklite at 4:34 PM on August 11, 2005


Significant whitespace sucks.

Plus, it's a rip-off.
posted by betaray at 4:43 PM on August 11, 2005


I always thought significant whitespace sucked. But then I decided to really learn Python, and I committed to keeping an open mind.

And y'know what?

Significant whitespace sucks.
posted by Zed_Lopez at 5:10 PM on August 11, 2005


you bastard. I already learned CSS, PHP, XML and Javascript this summer, now you got me working on Python??? When the hell am I gonna work??
posted by Edible Energy at 5:52 PM on August 11, 2005


Python is rapidly becoming my secret weapon. I can bang out code in about one quarter the time it takes in other languages, and the program generally works perfectly the first time.
posted by Nyrath at 6:12 PM on August 11, 2005


I tried completing the challenge with perl when it was on /. and I got as far as the pickle / unpickle step which AFAIK is python specific. So to all other non conformists, you're going to have to learn python for this challenge.
posted by ecco at 6:53 PM on August 11, 2005


I'm doing this in Ruby.

Screw you Python, but great quiz so far.
posted by parki at 7:25 PM on August 11, 2005


Hmm.. even after a warning. You're asking for disappointment.

[semi spoiler below]

Does ruby have a pickle library? Unless you can simulate the pickle.Unpickler() function to process a jpeg file. Then you will not be able* to complete the python challenge with Ruby.

*Well you could always implement relevant pickle library in Ruby but that isn't the point of the Python challenge. Just learn the language and jump through the hoops.. It's enough of a challenge in the intended language.
posted by ecco at 8:30 PM on August 11, 2005


Why do people think significant whitespace sucks? Do you not indent your code in other languages?
posted by kenko at 9:01 PM on August 11, 2005


Didn't mean to sound like I was bashing Python as hard as that came across - I don't mind Python at all (I don't think the whitespace thing is that big of an issue, but I still find it irksome). Liked using Jython a lot (v. powerful as a Java scripting language). Just like Ruby more.

Bummer about the dependence on Python in this challange - a way cool idea, better imho if not tied to a specific language.
posted by parki at 9:23 PM on August 11, 2005


Have you used Python, Kenko?

The significant whitespace makes it harder to see errors resulting from code being in the wrong block.

In a language with delimiters, your editor can auto-indent. In Python, it can't (it can guess, but you always have to be paying attention in case you need to correct it.) Corollary: when refactoring code or cutting and pasting from examples, you end up having to adjust every line by hand to get it right. Commenting out and uncommenting blocks of code is more difficult.

Basically, it's a needless pain in the ass. That's the most frustrating things about Python: its worst features aren't the unfortunate side-effects of useful things, like other languages' worst features tend to be -- they're arbitrary.

(I have a long list of things I like about Python, too; I just wanted to join in the hate of significant whitespace.)
posted by Zed_Lopez at 10:53 PM on August 11, 2005


Significant Whitespace is beautiful.

I love that the shape of code on the page isn't unrelated to its function. If Emacs python-mode isn't doing the indenting for you correctly, your code is either very messy, or written like another language which shall remain nameless, but in which "&^$#*^" is probably a full application with unicode support. And memoizing.

I totally disagree it makes it hard to see wrong-block errors: you see a physical difference between blocks of code; I think it makes it much easier to see which blocks are which.
posted by freebird at 11:13 PM on August 11, 2005 [1 favorite]


If Emacs python-mode isn't doing the indenting for you correctly, your code is either very messy

And how, praytell, does the supposed messiness of my code affect python-mode's behavior? Seriously, I do not understand your assertion. My complaint is that instead of having the mental freedom of always letting the editor auto-indent without worrying about it screwing up my code, I have to always be devoting attention to making sure it's not putting the code in the wrong place, which it starts to do whenever I'm adding a line of code after the end of the implicit, invisible end-of-block. How does messiness or cleanliness of code affect any of this?
posted by Zed_Lopez at 11:30 PM on August 11, 2005


I have a long list of things I hate about python, too; I'm just having Issues with the self-realization that I would give a crap about the aesthetics of computer languages.

But it's always worth caring about the aesthetics of anything you work with, so why not.

I find emacs python-mode works nearly flawlessly, and that it breaks or gets confusing mostly when I have overlong and tangled blocks. I like to think of blocks as paragraphs, and like the way they look on the page in python, like little stories. I just really like form determining function and vice versa - it reminds me of some aspects of biology, and makes the act of writing code more fun. I could see how it might drive one batshit crazy though, too.

And I totally feel your pain about cut/paste hassles with python examples, though.
posted by freebird at 11:53 PM on August 11, 2005


Have you used Python, Kenko?

Have you, Zed_Lopez?

The significant whitespace makes it harder to see errors resulting from code being in the wrong block.

I have never had a problem with this in three years of programming Python. And it makes it very hard for your program to be broken by a missing delimiter or brace somewhere. YMMV.

I agree this can make cut and paste a little more difficult, but not very much if your editor has a decent Python mode like Emacs.
posted by grouse at 12:09 AM on August 12, 2005


I have never had a problem with this in three years of programming Python. And it makes it very hard for your program to be broken by a missing delimiter or brace somewhere. YMMV.

Same with me. In fact, I find it much easier to spot an incorrectly indented line in Python than a missing brace or semicolon in C. And I never had any issues with my editor screwing up blocks.

I'm not going to say Python's significant whitespace is perfect --- for one thing, commenting/uncommenting lines can be a pain. Just saying it's not as bad as some people here are claiming. But that's me. YMMV, as above.
posted by Goblindegook at 1:20 AM on August 12, 2005


I've used Python quite a bit, and don't like it. I tried hard to like it, but I just find it clunky. The way classes work. The way main is defined. Yuck.

I've no real feelings towards the significant whitespace issue, one way or the other. It's almost as good as the proper way of doing things, and doesn't take too long to get used to.
posted by veedubya at 2:43 AM on August 12, 2005


The editor I use doesn't have a Python-mode (other than basic syntax-highlighting), and I've never had a problem with cutting and pasting code - obviously you need to reindent, but you have to do that anyway, right?

veedubya, what background are you coming from? People familiar with Java/C# will say yuck about those things for one reason, while people working in Smalltalk might say it for another. (I can't see why people who use PHP or Perl would think it was more clunky - those languages are yuck.)
posted by wilberforce at 2:49 AM on August 12, 2005


My commercial background is mostly C, C++, Java, and now C#. Dabbled with other stuff. I've used enough Perl to have been badly burned by it, and I quite like PHP, although its OO is horrible. I don't like Smalltalk.

I like functional languages, and if I could I would use Gopher for just about everything. I guess that's why Python feels clunky to me. The significant whitespace makes it look, at first glance, like a functional language, but it has none of the elegance, simply repeats the same mistakes of just about every procedural language since Algol.

I've only glanced at Ruby, so far, but that looks like something I might like.
posted by veedubya at 5:09 AM on August 12, 2005


My commercial background is mostly C, C++, Java, and now C#. Dabbled with other stuff. I've used enough Perl to have been badly burned by it, and I quite like PHP, although its OO is horrible. I don't like Smalltalk.

I like functional languages, and if I could I would use Gopher for just about everything. I guess that's why Python feels clunky to me. The significant whitespace makes it look, at first glance, like a functional language, but it has none of the elegance, simply repeats the same mistakes of just about every procedural language since Algol.

I've only glanced at Ruby, so far, but that looks like something I might like.
posted by veedubya at 5:10 AM on August 12, 2005


Sorry about the double-post. Blame the JRun. Blame the server. Blame anyone but me.
posted by veedubya at 5:18 AM on August 12, 2005


me, I heart Python. Coming to it from Java it was lovely not to have to worry about all those goddamned curly brackets everywhere.
posted by corvine at 5:51 AM on August 12, 2005


I'm working in C# at the moment, and jumping through hoops for static typing is really getting me down - that's the bit that I most like about Python. Significant whitespace is cool, but it's not essential - if I could work in Ruby or Smalltalk but not in Python I wouldn't mind much.

Haskell is pretty amazing, although I don't seem to be able to grok monads (and thus any communication with the outside world) at all. Potentially a modern typesystem would mean that I wouldn't be bumping into it as much as I am with the creaky C# one.

But I find Python so enjoyable to code in that I tend not to be pushed towards the static-typing end of the pool.
posted by wilberforce at 7:06 AM on August 12, 2005


I don't really understand the fixation people have on significant whitespace. Love it or hate it, it is a small part of using Python. I guess it's just a very visible and somewhat strange thing that people have to deal with before getting to any other parts of the language.

For me the best part of Python is way it just works the way you expect it to without any bullshit. I'm consistently amazed at how you can just retype algorithms out of a textbook or from another language and have them work without having to implement any infrastructure.
posted by joegester at 8:53 AM on August 12, 2005


Since everyone's chiming in with their Python opinions: I think it's a pretty solid language overall, but it has some minor defects. Syntactically-significant whitespace is as easy to work with with as delimited blocks if you have a decent editor, but unfortunately I find that it does make code refactoring somewhat more error-prone. The class system also feels a bit weak to me, really little more than glorified namespaces. On the plus side, it's about as readable as any language I've seen, the standard library is excellent, and it has a lot of developer momentum (more so than Ruby, although that could change in coming years due to Rails, etc.).

A lot of people talk about how it scales well to bigger projects. That's true to a point (the module, package, and class systems are fairly capable), but I find that the dynamic type system can result in a lot of wasted time tracking down bugs. On bigger projects I'm more productive with an inferred, strong, static typing system like ML or Haskell provides.

wilberforce: if you like Haskell but are longing for good old imperative IO, you may be happier with OCaml. As a bonus, OCaml offers very good performance, comparable to C++ for many tasks.
posted by Galvatron at 12:06 PM on August 12, 2005


Python: code the way Guido indented it.
posted by 3.2.3 at 8:32 PM on August 12, 2005


"I don't like Smalltalk....I've only glanced at Ruby, so far, but that looks like something I might like."

I've only glanced at Ruby, so far, but it looks like SmallTalk (without the bizarre, heaving runtime, which isn't so much a language feature as an unfortunate accident of implementation tradition, a la Forth).
posted by majick at 7:51 AM on August 13, 2005


without the bizarre, heaving runtime, which isn't so much a language feature as an unfortunate accident of implementation tradition, a la Forth

meaning the Forth dictionary? it's about as compact as a runtime gets for any language.
posted by 3.2.3 at 12:15 PM on August 15, 2005


I adore Forth, the language. Standard implementations, however, have a horrible, horrible flaw: 'BLOCK' I/O. Nasty implementation tradition, that.
posted by majick at 3:28 PM on August 18, 2005


« Older Permafrost - n. Ground that is permanently frozen.   |   Intresting headline for an intresting article. Newer »


This thread has been archived and is closed to new comments