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 ) 

preferred?

Violates EAFP obviously but...

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to