Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
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 ответов
+ 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.