On 03/10/17 20:05, Dennis Lee Bieber wrote:
>
> while True:
>       x = input("Enter a number (blank to exit) => ")
>       if x:
>               try:
>                       ix = int(x)
>                       print("Square = %s" % (ix * ix) ) #why invoke 
> exponential
>               except checkTheDocsForException:

The nice thing about how the stdlib does exceptions is that you can be
pretty certain that this has simply got to be a ValueError. It's still
best to check (or, in this case, try it out) - but you just know that
there's nothing else it can be.

>                       print(" '%s' is not a valid integer" % x )
>       else:
>               break


PS: I was weak. I tried it out before sending this mail.


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to