[Tutor] project euler #4
Alan Gauld
alan.gauld at yahoo.co.uk
Tue May 12 03:52:34 EDT 2020
On 12/05/2020 02:19, Mats Wichmann wrote:
> On 5/11/20 5:39 PM, Alan Gauld via Tutor wrote:
>> On 11/05/2020 19:08, Mats Wichmann wrote:
>>>
>>> def isPalindrome(n):
>>> n = str(n).casefold() # eliminate any string case differences
>>
> Casefolding is similar to lowercasing but more aggressive because it
> is intended to remove all case distinctions in a string. For example,
> the German lowercase letter 'ß' is equivalent to "ss". Since it is
> already lowercase, lower() would do nothing to 'ß'; casefold() converts
> it to "ss".
Aha! We don't have any equivalent ambiguities in English so no
wonder I couldn't find a difference. Thanks for clarifying.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list