How add a str to another str from he come from a for bucle?

If I want that the output be “so” and not “os” without turning them?

a = ''
for s in range(5):
    a += "s\n"
    a += "o"
print(a)

output :

s
os
os
os
os
o

If you add a linebreak after the s, then you get a linebreak after the s.

I will try tomorrow, it’s late in Europe

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.