►
Run
x = '125a' try: output = int(x) print(output) print(type(output)) except ValueError: print('Cannot convert to integer')
Output