On Tue, Jan 31, 2012 at 15:50, Michael Lewis <mjole...@gmail.com> wrote:
> ... However, if I pass in a string, it's converted to ASCII and will
> still satisfy the if statement and print out value. How do I ensure that a
> string is caught as a ValueError instead of being converted?

It depends on what you want to do if you catch a string. If you just
want to end the function, you could just try returning on the
exception, rather than passing. This will stop the string from being
processed any further.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to