1 / 3
Jan 2007

Hi, people.

Is it possible to upgrade python to 2.5? Today, my initial submission to DELCOMM failed with a NZEC because spoj still uses python 2.4, the same program worked fine on my machine with 2.5. I had to downgrade the program to get accepted.

  • created

    Jan '07
  • last reply

    Jan '07
  • 2

    replies

  • 130

    views

  • 2

    users

I think Python will be upgraded in the next "languages upgrade wave".
Are there significant improvements in Python, concerning SPOJ-like problems?

Actually I'm using SPOJ to learn python, so I can't give an expert answer.

That being said, the library in 2.5 is expanded: in my case, I tried to use "ric.bit".partition("."), whose answer is the tuple ("ric",".","bit"). To get acc I had to replace partition() with split() and some extra glue logic.

Another nice thing is the ternary-operator idiom:

a="ric" if i<10 else "bit"

instead of

if i<10:
  a="ric"
else: 
  a="bit"