Light Mode
Dark Mode
How to print without line break but with space?

Could someone tell me how to print result without break but with space.

For example:

for v in range(1,10):

print(v, end='')

output of above would be 123456789. But I want 1 2 3 4 5 6 7 8 9.

I also tried:

for v in range(1,10):

print(v, end=' ')

but this one will be 1 2 3 4 5 6 7 8 9 . <- I don't want last space after 9! help!

  • print()
Created: Oct. 16, 2016, 8:07 a.m.
Updated: Oct. 17, 2016, 5:35 p.m.
0
5
User avatar
violet.tk