[Tutor] Dividing a float derived from a string

Alan Gauld alan.gauld at btinternet.com
Fri Nov 21 15:05:34 CET 2014

On 21/11/14 13:19, Stephanie Morrow wrote:
> try:
>     print float(input) * 12
> except: TypeError, ValueError:
>     print False
> The "try" is coming up as red.  Any idea why?

Sorry, I left the colon in after the else.
I think that's what's confusing it...
It should read:

except TypeError, ValueError:

Alan G
Author of the Learn to Program web site
Follow my phopto-blog on Flickr at:

More information about the Tutor mailing list