I am trying to make a code that converts string into int and doesn't make any errors when the string is letters. My idea is to check if that string is numbers and if it is then it would do something. If it is not, it will print something and will go back to the start of the function. Example:
i = ()
def converter(i):
i = input()
if isinstance(i, int) == True:
print('i is an integer')
else:
print('i is not an integer')
converter(i)
#doesn't work :(
Or something along the lines. The idea is for the program not to crash when a string is typed in and that's why I can't use i = int(input()). Thanks in advance and have a nice day!