The Python Oracle

How do you check in python whether a string contains only numbers?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Cool Puzzler LoFi

--

Chapters
00:00 Question
00:32 Accepted answer (Score 297)
01:26 Answer 2 (Score 54)
01:39 Answer 3 (Score 16)
01:53 Answer 4 (Score 9)
02:21 Thank you

--

Full question
https://stackoverflow.com/questions/2138...

Accepted answer links:
[isdigit]: https://docs.python.org/3/library/stdtyp...

Answer 2 links:
[str.isdigit]: http://docs.python.org/2.7/library/stdty...

Answer 3 links:
[isdigit]: https://docs.python.org/3/library/stdtyp...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #string #numbers

#avk47