How do I check if a string is a number (float) in Python?

You can use in-built function isdigit() to check if a string is a number (float) in Python as shown in the below example –

Leave a Reply