I'm trying to write super simple code where I take input and print it.
userInput = input('enter: ')print(userInput)The problem that I'm having is when I'm stopping code while the input line is running, I'm getting a error:
Traceback (most recent call last): File "C:\Users\97258\PycharmProjects\pythonProject6\tast.py", line 1, in <module> input('enter: ') File "<frozen codecs>", line 319, in decodeKeyboardInterruptI was given a task to somehow make the code not to crash.
I tried adding the try and catch function but it didn't help, probably because the code stops before the catch can catch it.
I'm only expecting the code to not give me an error and finish with exit code 0 or -1 when I stop the code.