Obaid Obaid - 1 year ago 154
Python Question

printing list in python properly

So I have a list:

['x', 3, 'b']

And I want the output to be:

[x, 3, b]

How can I do this in python?

If I do
str(['x', 3, 'b'])
, I get one with quotes, but I don't want quotes.

Answer Source
mylist = ['x', 3, 'b']
print '[%s]' % ', '.join(map(str, mylist))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download