strings
Nick Welch
mack at incise.org
Thu Sep 4 01:11:11 EDT 2003
On Thu, Sep 04, 2003 at 04:18:38AM +0000, Scribe wrote:
> if it is a decimal I want to return the number without the commer any
> others return 0.
"commer"?
str.isdigit() should do most of it for you.
def foo(mystr):
if mystr.isdigit():
return "the number without the commer (??) :)"
else:
return 0
--
Nick Welch aka mackstann | mack @ incise.org | http://incise.org
Penguin Trivia #46:
Animals who are not penguins can only wish they were.
-- Chicago Reader 10/15/82
More information about the Python-list
mailing list