>>352
join使いにくくない?

n = 10
print(' '.join([str(i) for i in range(n)]))

https://ide.geeksforgeeks.org/M63S2nGWOC