Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:error': 0.03; 'posting.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.12; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'string,': 0.24; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'mode': 0.30; '"",': 0.31; 'larry': 0.31; 'file': 0.32; '(most': 0.33; 'test': 0.35; 'but': 0.35; 'really': 0.36; 'sequence': 0.36; 'list': 0.37; 'expected': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'easy': 0.60; 'subject: ': 0.61; "'0123456789'": 0.84; 'received:fios.verizon.net': 0.84; 'subject:Lists': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: I am out of trial and error again Lists Date: Thu, 23 Oct 2014 02:31:15 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-16-203-145.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414045891 news.xs4all.nl 2951 [2001:888:2000:d::a6]:58328 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79502 On 10/22/2014 10:58 PM, Larry Hudson wrote: > This give you a list not a string, but that's actually what you want > here. If you _really_ want a string, use join(): "".join(list(range(10))) Interactive mode makes it really easy to test before posting. >>> "".join(list(range(10))) Traceback (most recent call last): File "", line 1, in "".join(list(range(10))) TypeError: sequence item 0: expected string, int found >>> "".join(str(i) for i in range(10)) '0123456789' -- Terry Jan Reedy