<br><br><div class="gmail_quote">On Wed, Jul 4, 2012 at 12:16 AM, levi nie <span dir="ltr"><<a href="mailto:levinie001@gmail.com" target="_blank">levinie001@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
print "aList is "+string(aList) ?<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">2012/7/4 levi nie <span dir="ltr"><<a href="mailto:levinie001@gmail.com" target="_blank">levinie001@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
aList is a list.i want to get the output seem this "aList is [x,x,x,x,x,x,x,x,x]"<div>how can i get this?</div><div>it's wrong when i write this, print "aList is "+[x,x,x,x,x,x,x,x,x]</div>
</blockquote></div><br>
</div></div><br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br><div>Try this:<br><br>print "aList is", aList</div><div><br></div><div>That shows it like your example. The problem with how you were trying it is, you have a string and a list and you're trying to combine (concatenate) them. That doesn't work. One way to get around that is to change the list into a string, like your second post (it would be str(aList), by the way). By separating them with a comma instead of a plus, the print statement does that for you, and also inserts a space in-between them.</div>