¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
How can we iterate in the same line?
As we use while or for loop with each time the loop runs, line breaks. I want to know how to avoid it.
2 Respuestas
+ 5
If you are talking Python, the print always ends the line, unless you tell it differently. This stops it:
print("test", end="")
The end string gets added to the output so ", " could be used to add a comma and space.
+ 4
Place your line break outside the loop. It would be better if you post your code to get a working sample, though.