Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.030 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.01; '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; 'language.': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'print': 0.22; 'header:User- Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'work.': 0.31; 'guess': 0.33; 'too': 0.37; 'list': 0.37; 'to:addr:python-list': 0.38; 'little': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'subject: ': 0.61; 'name:': 0.61; 'skip:n 10': 0.64; 'our': 0.64; 'charset:windows-1252': 0.65; 'url:i': 0.72; 'url:jpg': 0.83; 'url:imgur': 0.84; 'str.': 0.91; 'subject:Lists': 0.91; 'why?': 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: Sat, 25 Oct 2014 00:27:53 +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-78-147-176-229.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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414193287 news.xs4all.nl 2905 [2001:888:2000:d::a6]:59893 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79632 On 24/10/2014 23:58, Seymore4Head wrote: > On Wed, 22 Oct 2014 16:30:37 -0400, Seymore4Head > wrote: > > name="123-xyz-abc" > a=range(10) > b=list(range(10)) > c=str(list(range(10))) > print ("a",(a)) > print ("b",(b)) > print ("c",(c)) > > for x in name: > if x in a: > print ("a",(x)) > if x in b: > print ("b",(x)) > if x in c: > print ("c",(x)) > > B is type list and C is type str. > I guess I am still a little too thick. I would expect b and c to > work. > http://i.imgur.com/dT3sEQq.jpg > Why? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence