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

2014-06-20 Thread Nicholas Cannon
Guys i am only a beginner at python most of the stuff you are saying i need to do i dont understand. -- https://mail.python.org/mailman/listinfo/python-list

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

2014-06-20 Thread Ian Kelly
On Fri, Jun 20, 2014 at 12:14 AM, Nicholas Cannon nicholascann...@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. All we're saying is that the simplest and most accurate way to determine whether a string can be converted to

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

2014-06-20 Thread Sturla Molden
Nicholas Cannon nicholascann...@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 :-) In C it is customary to do all sorts of sanity checks in advance. Validating user input is an example. We can

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

2014-06-20 Thread Mark Lawrence
On 20/06/2014 14:16, Sturla Molden wrote: Nicholas Cannon nicholascann...@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

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

2014-06-20 Thread Grant Edwards
On 2014-06-20, Mark Lawrence breamore...@yahoo.co.uk wrote: For the OP a very important rule of thumb is never use a bare except, so this is right out. try: doSomething() except: WTF() IMO, that sort of depends on WTF() does. One case where a bare except is well used is when

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

2014-06-20 Thread alister
On Fri, 20 Jun 2014 14:28:52 +, Grant Edwards wrote: On 2014-06-20, Mark Lawrence breamore...@yahoo.co.uk wrote: For the OP a very important rule of thumb is never use a bare except, so this is right out. try: doSomething() except: WTF() IMO, that sort of depends on

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

2014-06-20 Thread Ian Kelly
On Fri, Jun 20, 2014 at 8:28 AM, Grant Edwards invalid@invalid.invalid wrote: On 2014-06-20, Mark Lawrence breamore...@yahoo.co.uk wrote: For the OP a very important rule of thumb is never use a bare except, so this is right out. try: doSomething() except: WTF() IMO, that sort

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

2014-06-19 Thread Gary Herron
On 06/18/2014 10:53 PM, nicholascann...@gmail.com wrote: I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered an int value. I need the same for floating point types so i could implement an or in the if

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

2014-06-19 Thread Nicholas Cannon
On Thursday, June 19, 2014 1:53:31 PM UTC+8, Nicholas Cannon wrote: I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered an int value. I need the same for floating point types so i could implement an or

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

2014-06-19 Thread Ben Finney
Nicholas Cannon nicholascann...@gmail.com writes: #checks if the user input is an integer value def checkint(a): if a.isnumeric(): return True else: if a.isalpha(): return False else: return

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

2014-06-19 Thread Ian Kelly
On Thu, Jun 19, 2014 at 12:48 AM, Nicholas Cannon nicholascann...@gmail.com wrote: On Thursday, June 19, 2014 1:53:31 PM UTC+8, Nicholas Cannon wrote: I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered

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

2014-06-19 Thread Ian Kelly
On Thu, Jun 19, 2014 at 1:23 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Jun 19, 2014 at 12:48 AM, Nicholas Cannon nicholascann...@gmail.com wrote: On Thursday, June 19, 2014 1:53:31 PM UTC+8, Nicholas Cannon wrote: I am making a calculator and i need it to support floating point values

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

2014-06-19 Thread Sturla Molden
nicholascann...@gmail.com wrote: I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered an int value. I need the same for floating point types so i could implement an or in the if statement that checks the