Saturday, 24 August 2013

Print range of numbers on same line

Print range of numbers on same line

Using python I want to print a range of numbers on the same line. how can
I do this using python, I can do it using C by not adding \n, but how can
I do it using python.
for x in xrange(1,10):
print x
I am trying to get this result.
1 2 3 4 5 6 7 8 9 10

No comments:

Post a Comment