[Tutor] close, but no cigar

Marc Tompkins marc.tompkins at gmail.com
Tue Jul 23 05:01:31 CEST 2013


On Mon, Jul 22, 2013 at 6:13 PM, Dave Angel <davea at davea.name> wrote:

> On 07/22/2013 02:27 PM, Jim Mooney wrote:
>
>> Okay, I'm getting there, but this should be translating A umlaut to an old
>> DOS box character, according to my ASCII table, but instead it's print
>> small 'u':
>>
>> def main():
>>      zark = ''
>>      for x in "ÀÄÄÄ":
>>          print(unichr(ord(u'x')-3), end=' ')
>>
>> result: u u u u
>>
>>
> You're not using any of the A-umlaut characters in that code.  You're
> repeatedly taking ord of the literal u'x'
>
> And naturally, u is 3 characters less than x.
>

Oooh - I missed that...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130722/7834b605/attachment-0001.html>


More information about the Tutor mailing list