[Tutor] rstrip in list?

Kent Johnson kent37 at tds.net
Tue Feb 9 17:49:37 CET 2010


On Tue, Feb 9, 2010 at 11:09 AM, Ken G. <beachkid at insightbb.com> wrote:
>
> Kent Johnson wrote:
>
> On Tue, Feb 9, 2010 at 10:28 AM, Ken G. <beachkid at insightbb.com> wrote:
>
>
> I printed out some random numbers to a datafile and use 'print mylist' and
> they came out like this:
>
> ['102\n', '231\n', '463\n', '487\n', '555\n', '961\n']
>
>
> How are you generating this list? You should be able to create it
> without the \n. That would be better than stripping them out.
>
>
> I inputting some random numbers into a database and then created a list
> and appended the list as it read the database.

If you show the code for this perhaps we can figure out where the
newlines are coming from.

Kent


More information about the Tutor mailing list