[Tutor] rstrip in list?
Ken G.
beachkid at insightbb.com
Tue Feb 9 16:28:43 CET 2010
I printed out some random numbers to a list and use 'print mylist' and
they came out like this:
['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
I was using 'print mylist.rstrip()' to strip off the '\n'
but kept getting an error of :
AttributeError: 'list' object has no attribute 'rstrip'
My memory must be hazy but I thought I had it working several months ago.
Any idea or suggestion?
TIA, Ken
More information about the Tutor
mailing list