Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107919
| From | Christopher Reimer <christopher_reimer@icloud.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Not x.islower() has different output than x.isupper() in list output... |
| Date | 2016-04-30 10:36 -0700 |
| Message-ID | <mailman.266.1462037788.32212.python-list@python.org> (permalink) |
| References | (2 earlier) <57241097.7020801@icloud.com> <1461998604.3888861.594056577.710E696D@webmail.messagingengine.com> <5724E1CF.9060905@icloud.com> <1462036309.4005755.594329209.1106AF27@webmail.messagingengine.com> <5724ED13.9070606@icloud.com> |
On 4/30/2016 10:11 AM, Stephen Hansen wrote: > You're thinking of the whole "string", but you're operating on > single-character substrings, and when " ".islower() is run, its false. > Because the two-pronged test, a) if all cased characters are lowercase > and b) there is at least one cased character. b) is failing. Ergo, > you're getting the underscores. I see where the problem lies in my thinking. I went looking for a single line solution for the whole string. If I had constructed a for loop and tried to reduce it to a single line, I *may* have understood the relationship between the different parts. Or maybe not. Blaming the documentation is a lot easier. ;) Thank you, Chris R.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Not x.islower() has different output than x.isupper() in list output... Christopher Reimer <christopher_reimer@icloud.com> - 2016-04-30 10:36 -0700
csiph-web