►
Run
x = '3.14 A' try: output = float(x) print(output) print(type(output)) except ValueError: print('Cannot convert to float')
Output