Python lines in one word


How to return this in one line? For example:
how to return ABCD instead of:


Hi @zutko123 ,

Put a comma at the very end of your print statement to suppress a line feed.


Thank you that works for print but i must return and that doesen't work



Regarding your original question and your first reply, try this example; see if it helps ...

letters = ["P", "y", "t", "h", "o", "n"]
for ch in letters:
    print ch, # output with no line feed
print # add a line feed
print "Done!" # announce that we are done


Thank you! :slight_smile:


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