Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77331
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'method.': 0.07; 'method,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'works.': 0.09; '-tkc': 0.16; 'does,': 0.16; 'false:': 0.16; 'itself,': 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; 'wrote:': 0.18; 'help.': 0.21; '>>>': 0.22; 'aug': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'choices': 0.24; 'received:comcast.net': 0.24; 'refers': 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; 'chase': 0.31; 'go.': 0.31; 'third': 0.33; 'something': 0.35; 'really': 0.36; 'method': 0.36; 'thanks': 0.36; 'should': 0.36; 'two': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'first': 0.61; 'between': 0.67; 'of:': 0.68; 'reads': 0.68; 'subject:have': 0.80; 'clearer': 0.84; 'subject:times': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Ned Batchelder <ned@nedbatchelder.com> |
| Subject | Re: I have tried and errored a reasonable amount of times |
| Date | Sat, 30 Aug 2014 16:20:56 -0400 |
| References | <b2540atcdbtj8hce9mnt4ml4i0nv5qso8u@4ax.com> <mailman.13646.1409424597.18130.python-list@python.org> <v6740aprghq946aj1r9mgk1j4865vivoqt@4ax.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | c-50-133-228-126.hsd1.ma.comcast.net |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
| In-Reply-To | <v6740aprghq946aj1r9mgk1j4865vivoqt@4ax.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13652.1409430069.18130.python-list@python.org> (permalink) |
| Lines | 47 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1409430069 news.xs4all.nl 2928 [2001:888:2000:d::a6]:60696 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:77331 |
Show key headers only | View raw
On 8/30/14 2:50 PM, Seymore4Head wrote:
> On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase
> <python.list@tim.thechases.com> 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
>>
> That works.
> Thanks
>
Also, instead of:
if e[0].isupper() == False:
if e[0].isupper() == True:
use:
if not e[0].isupper():
if e[0].isupper():
It's clearer and reads better.
--
Ned Batchelder, http://nedbatchelder.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I have tried and errored a reasonable amount of times Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-30 14:27 -0400
Re: I have tried and errored a reasonable amount of times Tim Chase <python.list@tim.thechases.com> - 2014-08-30 13:48 -0500
Re: I have tried and errored a reasonable amount of times Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-30 14:50 -0400
Re: I have tried and errored a reasonable amount of times Ned Batchelder <ned@nedbatchelder.com> - 2014-08-30 16:20 -0400
Re: I have tried and errored a reasonable amount of times Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-30 16:32 -0400
Re: I have tried and errored a reasonable amount of times Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-31 18:37 +1000
Re: I have tried and errored a reasonable amount of times Chris Angelico <rosuav@gmail.com> - 2014-08-31 19:16 +1000
Re: I have tried and errored a reasonable amount of times Grant Edwards <invalid@invalid.invalid> - 2014-09-02 16:43 +0000
Re: I have tried and errored a reasonable amount of times Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-02 12:59 -0400
Re: I have tried and errored a reasonable amount of times Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-03 11:44 +1000
Re: I have tried and errored a reasonable amount of times Rustom Mody <rustompmody@gmail.com> - 2014-09-02 20:14 -0700
Re: I have tried and errored a reasonable amount of times Steven D'Aprano <steve@pearwood.info> - 2014-09-03 07:16 +0000
Re: I have tried and errored a reasonable amount of times Marko Rauhamaa <marko@pacujo.net> - 2014-09-03 10:44 +0300
Re: I have tried and errored a reasonable amount of times Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-04 11:54 +1000
Re: I have tried and errored a reasonable amount of times Chris Angelico <rosuav@gmail.com> - 2014-09-04 12:03 +1000
Re: I have tried and errored a reasonable amount of times Rustom Mody <rustompmody@gmail.com> - 2014-09-03 19:23 -0700
Re: I have tried and errored a reasonable amount of times Marko Rauhamaa <marko@pacujo.net> - 2014-09-04 08:36 +0300
Re: I have tried and errored a reasonable amount of times Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-04 11:17 +0000
Re: I have tried and errored a reasonable amount of times Chris Angelico <rosuav@gmail.com> - 2014-09-04 21:42 +1000
Re: I have tried and errored a reasonable amount of times Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-05 02:53 +0000
Re: I have tried and errored a reasonable amount of times Chris Angelico <rosuav@gmail.com> - 2014-09-05 13:02 +1000
Re: I have tried and errored a reasonable amount of times Grant Edwards <invalid@invalid.invalid> - 2014-09-05 14:54 +0000
Re: I have tried and errored a reasonable amount of times Marko Rauhamaa <marko@pacujo.net> - 2014-09-05 19:45 +0300
Re: I have tried and errored a reasonable amount of times Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-30 22:21 +0100
Re: I have tried and errored a reasonable amount of times Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-08-30 17:48 -0400
Re: I have tried and errored a reasonable amount of times Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-30 23:32 +0100
Re: I have tried and errored a reasonable amount of times Cameron Simpson <cs@zip.com.au> - 2014-08-31 15:30 +1000
Re: I have tried and errored a reasonable amount of times Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-31 19:05 +1000
csiph-web