[Tutor] on the way to find pi
Max Noel
maxnoel_fr at yahoo.fr
Sun Jan 23 19:50:47 CET 2005
> This code gives the number in an unusual format like "3.1415'None'"
> it has a number part and a string part . I want to seperate these from
> easc other but I couldn't manage. I mean when I try to turn it into
> string format then try to use things like [:4] or like that they don't
> work.Any idea how to seperate this 'None' from the number and make it
> a real normal number on which I can do operations like +1 -1 or like
> that :)
> Regards
Well, you should try to have a look at where the "None" is appended to
the string representing the number, and use a type check to decide
whether or not you're appending/adding/whatever.
>>> type("abc")
<type 'str'>
>>> type(123)
<type 'int'>
>>> type(None)
<type 'NoneType'>
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
More information about the Tutor
mailing list