About 1,100,000 results
Open links in new tab
  1. What's the difference between str.isdigit (), isnumeric () and ...

    52 The Python documentation notes the difference between the three methods. str.isdigit Return true if all characters in the string are digits and there is at least one character, false otherwise. Digits …

  2. python - str.isdigit () behaviour when handling strings - Stack Overflow

    Sep 22, 2021 · 22 str.isdigit doesn't claim to be related to parsability as an int. It's reporting a simple Unicode property, is it a decimal character or digit of some sort: str.isdigit() Return True if all …

  3. python - str.isdecimal () and str.isdigit () difference example - Stack ...

    Reading python docs I have come to .isdecimal() and .isdigit() string functions and i'm not finding literature too clear on their usable distinction. Could someone supply me with code examples of ...

  4. python - Como verificar se o valor de variável string é numero? - Stack ...

    As strings em Python tem um método "isdigit": case.isdigit() - que retorna True ou False. Esse método é o suficiente se você quer só inteiros positivos - no entanto, se desejar validar também entrada de …

  5. python - isdigit not working for me - Stack Overflow

    Oct 23, 2015 · isdigit is a method on strings, not integers. If you have an integer it is already guaranteed to be all numeric, because it's a numeric type. How are you assigning an initial value to b?

  6. python - Using isdigit for floats? - Stack Overflow

    38 The existing answers are correct in that the more Pythonic way is usually to try...except (i.e. EAFP, "easier to ask for forgiveness than permission"). However, if you really want to do the validation, you …

  7. python - Difference between unicode.isdigit () and unicode.isnumeric ...

    Jun 24, 2014 · The Python 3 documentation is a little clearer than the Python 2 docs: str.isdigit() [...] Digits include decimal characters and digits that need special handling, such as the compatibility …

  8. Checking .isdigit() on python - Stack Overflow

    Apr 11, 2018 · Use isdecimal not isdigit (and Python 3). isdigit is an unsafe test because it recognises characters like unicode power-of-2, ² , as a digit which can not be converted to integers.

  9. python - Shorter way to check if a string is not isdigit () - Stack ...

    May 2, 2013 · Shorter way to check if a string is not isdigit () Asked 12 years, 7 months ago Modified 2 years, 6 months ago Viewed 84k times

  10. python - Why isdigit () return false on float? - Stack Overflow

    Apr 26, 2017 · 9 str.isdigit() will only return true if all characters in the string are digits. . is punctuation, not a digit. From the Python 3 str.isdigit() documentation: Formally, a digit is a character that has the …