← Back to topics
Topic

Python help

b
bjuric
I started learning python but I'm having some problems running solutions here.

What version of python is in use?
Is shebang ('#!') needed on z-trening?

For example, I can run 'Sum of Two numbers' on my machine using ver 2.7 and 3.1, but getting TLE here.

What I'm I missing?
k
karakondzula
I don't know python but here is example of program that work on z-trening:
http://www.z-trening.com/forum.php?show_board=10002&ref_id=10002&view_topic=111942
b
bjuric
Thanks man, but I've seen that.
Tried adopting that for the 'Sum' problem, but no go.
As I understand, I shouldn't need to import sys for simple input-print operations.
I mean, I can run programs locally with core input-print functions.

Thanks again.
Hope someone here uses python.
b
bjuric
Found the solution.

If anyone cares...
Test inputs are space separated in a single line.
So the code for the 'Sum' problem would be:

a,b = raw_input().split()
print int(a) + int(b)