SPOJ — programming exercises

The Sphere Online Judge has thousands of programming exercises you can try (submit your code and see if it’s correct!) in lots of different languages. I’m only a (extremely) novice python programmer; here is my first submission to exercise 1 (code TEST):

#!/usr/bin/env python

n = 0
while n != 42:
    n = input()
    if n == 42:
    print n

I think it’s a little ugly, with redundant bits of code. Maybe this could actually be done with around three lines rather than six? (Okay maybe not.)


1 Response to “SPOJ — programming exercises”

  1. 1 karen millen ebay outlet July 4, 2013 at 22:10

    This necessitates sincerity and respect of the
    natural environment one particular is in. Kooba’s Dasha handbag can be employed for any situation. The quartz watch is the most important as it is the one particular regarded as the automatic. All Accessibility: Manner has returned to Tyson Galleria in McLean, VA.

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 )

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

%d bloggers like this: