Oct-05-2019, 06:28 PM
Easy enough to write -
def is_it_a_duck(str): try : foo = float(str) return True except : return False print(is_it_a_duck("4.5"))This returns true for things that float. OK it catches all exceptions, not just Value, but it works for the task at hand...