Re: [Tutor] ASCII Conversion

2012-01-31 Thread Joel Goldstick
On Tue, Jan 31, 2012 at 4:06 AM, Russel Winder wrote: > On Tue, 2012-01-31 at 07:33 +0200, Christian Witts wrote: >> [...]o with >> `type(y) == int`, and to get the ASCII value of a character you can use >> `ord` like `ord('a') == 97`. And how to avoid your ValueError with a bad >> conversion, do

Re: [Tutor] ASCII Conversion

2012-01-31 Thread Russel Winder
On Tue, 2012-01-31 at 07:33 +0200, Christian Witts wrote: > [...]o with > `type(y) == int`, and to get the ASCII value of a character you can use > `ord` like `ord('a') == 97`. And how to avoid your ValueError with a bad > conversion, do your type checking before hand. isinstance ( y , int )