´ð¸´: ´ð¸´: how to remove \n in the list

Discussion in 'Python' started by Penny Y., Apr 14, 2008.

  1. Penny Y.

    Penny Y. Guest

    that's right. got it thanks.

    ·¢¼þÈË: python-list-bounces+pylists=
    [mailto:python-list-bounces+pylists=] ´ú±í Eric Brunel
    ·¢ËÍʱ¼ä: 2008Äê4ÔÂ14ÈÕ 16:17
    Ö÷Ìâ: Re: ´ð¸´: how to remove \n in the list

    (please avoid top-posting... corrected)
    ['5\n', '2\n', '7\n', '3\n', '6\n']

    ['5', '2', '7', '3', '6']

    Assigning to lines[:] changes the original list. Assigning to lines
    rebinds the name to the result of the list comprehension, but doesn't
    affect the original list.

    Penny Y., Apr 14, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.