How will you check in a string that all characters are digits?



How will you check in a string that all characters are digits?..

Answer / Saurabh Chandra

You can use the `isdigit()` method of Python strings to check if all characters are digits. For example: `if my_string.isdigit(): ...`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is flask- wtf? Explain its features.

1 Answers  


Is python interpreted language?

1 Answers  


What is a decorator?

1 Answers  


What animals sleep the least?

1 Answers  


How to python script executable on unix?

1 Answers  


What is the difference between numpy and pandas?

1 Answers  


Does flask work with python 3?

1 Answers  


Why python is better than r for data science?

1 Answers  


What is pack in python?

1 Answers  


What is keyword arguments in python?

1 Answers  


How to retrieve data from a table in mysql database through python code?

1 Answers  


Are uuids sequential?

1 Answers  


Categories