[Tutor] three numbers for one

Jim Mooney cybervigilante at gmail.com
Sat Jun 8 17:09:08 CEST 2013


Steven D'Aprano <steve at pearwood.info>

> Are you talking about the string methods, isdigit, isdecimal and isnumeric
> in Python 3? You should say so rather than have us guess.

If it's not the header in a program fragment, assume PY3 for the next
year, at least. I don't plan on changing again - even if they come out
with Py4 ;')

> it is usually better to just call int(s) and catch the exception.

Actually, I like that better than other tests  Putting  try..except
in a  while True  loop and breaking out when the try succeeds seems
the most natural way to do input, to me.

Jim


More information about the Tutor mailing list