What is the best possible way to check if a string can be represented as a number in Python?
The function I currently have right now is:
def is_numb
This code handles the exponents, floats, and integers, wihtout using regex.
return True if str1.lstrip('-').replace('.','',1).isdigit() or float(str1) else False