how to check if a value is a floating point or not

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jun 20 09:40:38 EDT 2014


On 20/06/2014 14:16, Sturla Molden wrote:
> Nicholas Cannon <nicholascannon1 at gmail.com> wrote:
>
>> Guys i am only a beginner at python most of the stuff you are saying i
>> need to do i dont understand.
>
> Then listen and try to learn :-)
>
> But don't use try/except everywhere! Some exceptions might be due to an
> error in your own code, i.e. not in the user input. Those errors you should
> not silence, but let your program crash and abort. Then you will know there
> is an error in your code. That is what an unhandled exception will do, and
> in addition it will tell you where the error is and what it is, so just
> leave those exceptions unhandled.
>

For the OP a very important rule of thumb is never use a bare except, so 
this is right out.

try:
     doSomething()
except:
     WTF()

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com





More information about the Python-list mailing list