Can someone tell me a method to check how can I represent a string as a number in Python?
I am using this function right now:
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
This method is slow and clunky. So please help me with it.