Answer the question
In order to leave comments, you need to log in
How to display the contents of a list as a single line?
There is a list chart:
chart = ["Q", "A", "D", "W"]
if you use the print(chart) command, you get the following:
["Q", "A", "D", "W" "]
how do I output the contents of the list as a single line without spaces? Like this:
QADW
Thank you in advance to all who responded.
P.S. Python 3.4.
Answer the question
In order to leave comments, you need to log in
print "".join(chart)
if there are already rows in chart. Otherwiseprint "".join(map(str, chart))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question