if __name__ == '__main__':
user = input('Enter user name: ')
print(f'Hello, {user}')
exit(0)
import sys
if __name__ == '__main__':
user = input('Enter user name: ')
print(f'Hello, {user}')
sys.exit(0)
Instead of using exit()
or quit()
, consider using the sys.exit()
.