newbie question

Ian Kelly ian.g.kelly at gmail.com
Tue Jun 25 15:05:17 EDT 2013


On Sat, Jun 22, 2013 at 8:49 PM, Gene Heskett <gheskett at wdtv.com> wrote:
> On Saturday 22 June 2013 22:46:51 christhecomic at 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'



More information about the Python-list mailing list