Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:error': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suggest': 0.14; 'language.': 0.14; 'question.': 0.14; 'get,': 0.16; 'happened?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntax,': 0.16; 'traceback.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'wed,': 0.18; '>>>': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'work.': 0.31; 'code': 0.31; '+0100,': 0.31; 'correctly.': 0.31; 'actual': 0.34; 'thanks': 0.36; 'should': 0.36; 'error.': 0.37; 'to:addr:python- list': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'subject: ': 0.61; 'full': 0.61; 'numbers': 0.61; 'simply': 0.61; "you've": 0.63; 'happen': 0.63; 'our': 0.64; 'more': 0.64; 'charset:windows-1252': 0.65; 'invalid': 0.68; 'prompt': 0.68; 'url:a': 0.72; 'click': 0.77; 'url:imgur': 0.84; 'received:89': 0.85; 'subject:Lists': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: I am out of trial and error again Lists Date: Thu, 23 Oct 2014 00:44:01 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-89-240-167-43.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414021456 news.xs4all.nl 2972 [2001:888:2000:d::a6]:46782 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79483 On 23/10/2014 00:26, Seymore4Head wrote: > On Wed, 22 Oct 2014 23:55:57 +0100, Mark Lawrence > wrote: > >> On 22/10/2014 23:30, Seymore4Head wrote: >>> On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head >>> wrote: >>> >>> One more question. >>> if y in str(range(10) >>> Why doesn't that work. >> >> Invalid syntax, it should obviously be:- >> >> if y in str(range(10)): >> >> OTOH if you've simply mistyped above what did you expect to happen and >> what actually happened? Give us the actual code that you ran and the >> full traceback. > > I don't get an error. It just doesn't print the numbers correctly. > http://imgur.com/a/2loQV > You can click on the images and make them larger. > Thanks > I suggest you try str(range(10)) from the interactive prompt and see exactly what you get, as it's nothing like what you expect :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence