On Fri, Jun 20, 2014 at 8:28 AM, Grant Edwards wrote:
> On 2014-06-20, Mark Lawrence 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. On
On Fri, 20 Jun 2014 14:28:52 +, Grant Edwards wrote:
> On 2014-06-20, Mark Lawrence 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() doe
On 2014-06-20, Mark Lawrence 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 stdandard output/er
On 20/06/2014 14:16, Sturla Molden wrote:
Nicholas Cannon 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 co
Nicholas Cannon 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 call this "to ask permis
On Fri, Jun 20, 2014 at 12:14 AM, Nicholas Cannon
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 an int or a float is to
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
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 values the user has en
On Thu, Jun 19, 2014 at 1:23 AM, Ian Kelly wrote:
> On Thu, Jun 19, 2014 at 12:48 AM, Nicholas Cannon
> 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 isnume
On Thu, Jun 19, 2014 at 12:48 AM, Nicholas Cannon
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 an int
>> value. I n
Nicholas Cannon 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 True
What code
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 o
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
st
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 values the user has entered and all
14 matches
Mail list logo