[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: newbie question
From:       Ian Kelly <ian.g.kelly () gmail ! com>
Date:       2013-06-25 19:05:17
Message-ID: CALwzidkhrofZGYbMM-Ei5dPDttL3KWK5hpDn4dKOsW85rgcvhQ () mail ! gmail ! com
[Download RAW message or body]

On Sat, Jun 22, 2013 at 8:49 PM, Gene Heskett <gheskett@wdtv.com> wrote:
> On Saturday 22 June 2013 22:46:51 christhecomic@gmail.com did opine:
>
>> Writing simple program asking a question with the answer being
>> "yes"...how do I allow the correct answer if user types Yes, yes, or
>> YES?
>>
>> Thanks
>
> AND each character coming in from the keyboard with $DF before adding it to
> the comparison buffer.  Makes it all uppercase.  Then compare it to the
> uppercase YES.

It's not working for me.

>>> ''.join(chr(ord(c) & 0xdf) for c in 'ναί') == 'ΝΑΊ'
False
>>> ''.join(chr(ord(c) & 0xdf) for c in 'ναί')
'\x9d\x91\x8f'
-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic