I am new at coding. I am working on jupyter notebook using anaconda environment. I have this sample code where I am using sys.exit() command. When it gets executed it exits script with several error messages. Here is my sample code.
import sys
name = 'joh'
if name == 'john':
print('Name matches')
else:
print('Incorrect name')
sys.exit(0)
... some more code
Upon execution, it returns
Incorrect name
An exception has occurred, use %tb to see the full traceback.
SystemExit: 0
C:\Users\ankur.kulshrestha\AppData\Local\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2889: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
How can I gracefully exit the script without receiving all these error messages (apart from the first line which I have actually put in the code.)