isdigit() function in python by R4R Team

- isdigit() is a python in-build function which check the string contain only digits or not.
- if string contain only numbers then it will return True otherwise it will return False.

Example

string is "123"
it will return True

string is "mytext123"
it will return False



program-


s="my132"
print(s.isdigit())
s="132"
print(s.isdigit())
s="132my"
print(s.isdigit())
s="123445566"
print(s.isdigit())


output-


False
True
False
True


-In this program, we check the string contains only numeric digit or not by the s.isdigit(),




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!