import sys try: s = raw_input('Enter something --> ') except EOFError: print('\nWhy did you do an EOF on me?') sys.exit() # exit the program except: print('\nSome error/exception occurred.') # here, we are not exiting the program print('Done') 例子的全部代码,就这样的还要拿分?
luluoningsheng2024-12-29 07:26:09
import sys
try:
s = raw_input('Enter something --> ')
except EOFError:
print('\nWhy did you do an EOF on me?')
sys.exit() # exit the program
except:
print('\nSome error/exception occurred.')
# here, we are not exiting the program
print('Done')
例子的全部代码,就这样的还要拿分?
import sys try: s = raw_input('Enter something --> ') except EOFError: print('\nWhy did you do an EOF on me?') sys.exit() # exit the program except: print('\nSome error/exception occurred.') # here, we are not exiting the program print('Done') 例子的全部代码,就这样的还要拿分?
import sys try: s = raw_input('Enter something --> ') except EOFError: print('\nWhy did you do an EOF on me?') sys.exit() # exit the program except: print('\nSome error/exception occurred.') # here, we are not exiting the program print('Done') 例子的全部代码,就这样的还要拿分?