Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'method.': 0.07; 'string': 0.09; 'get.': 0.09; 'lawrence': 0.09; 'method,': 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; '-tkc': 0.16; 'does,': 0.16; 'false:': 0.16; 'itself,': 0.16; 'means.': 0.16; 'mylist': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subtle.': 0.16; 'true:': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'typing': 0.19; 'help.': 0.21; 'command': 0.22; '>>>': 0.22; 'aug': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; 'choices': 0.24; 'refers': 0.24; 'string,': 0.24; 'asking': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'testing': 0.29; 'tim': 0.29; "i'm": 0.30; 'getting': 0.31; "skip:' 10": 0.31; '+0100,': 0.31; '>>>>': 0.31; 'chase': 0.31; 'go.': 0.31; 'yourself.': 0.31; 'there.': 0.32; 'third': 0.33; 'something': 0.35; 'but': 0.35; 'really': 0.36; 'false': 0.36; "didn't": 0.36; 'method': 0.36; 'thanks': 0.36; 'should': 0.36; 'two': 0.37; 'to:addr:python- list': 0.38; 'little': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'ago.': 0.61; 'first': 0.61; 'our': 0.64; 'charset:windows-1252': 0.65; 'between': 0.67; 'prompt': 0.68; 'subject:have': 0.80; 'min': 0.84; 'subject:times': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: I have tried and errored a reasonable amount of times Date: Sat, 30 Aug 2014 23:32:54 +0100 References: <20140830134809.22099994@bigbox.christie.dr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-18-19-48.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.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: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409437993 news.xs4all.nl 2904 [2001:888:2000:d::a6]:50619 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77340 On 30/08/2014 22:48, Seymore4Head wrote: > On Sat, 30 Aug 2014 22:21:40 +0100, Mark Lawrence > wrote: > >> On 30/08/2014 19:48, Tim Chase wrote: >>> On 2014-08-30 14:27, Seymore4Head wrote: >>>> I really tried to get this without asking for help. >>>> >>>> mylist = ["The", "earth", "Revolves", "around", "Sun"] >>>> print (mylist) >>>> for e in mylist: >>>> >>>> # one of these two choices should print something. Since neither >>>> does, I am missing something subtle. >>>> >>>> if e[0].isupper == False: >>>> print ("False") >>>> if e[0].isupper == True: >>>> print ("True") >>>> >>>> I am sure in the first , third and fifth choices should be true. >>>> Right now, I am just testing the first letter of each word. >>> >>> There's a difference between e[0].isupper which refers to the method >>> itself, and e[0].isupper() which then calls that method. Call the >>> method, and you should be good to go. >>> >>> -tkc >>> >> >> For the OP use the interactive prompt to see for yourself. Compare:- >>>>> 'no'.isupper >> >>>>> 'no'.isupper() >> False >>>>> > That would work now, but I didn't even know no.isupper() was command > until 15 min ago. :) > > I have been told that one is a method and the other calls a method. I > still have to learn exactly what that means. I'm getting there. > > Thanks > Slow down a little :) 'no' is a string, isupper is just one of many methods that any string has. Try typing help('no') into the interactive prompt and see what you get. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence