异常:try: except: finally:
try:
lt.remove(value)
except ValueError as ve:
print("友好提示/对错误信信息得处理")
except ZeroDivisionError as e:
print("友好提示/对错误信信息得处理")
else:
print("友好提示/对错误信信息得处理")
finally:
self.t = tuple(lt)
常见异常:
IndexError ZeroDivisionError AttributeError ImportError ModuleNotFoundError: No module named ‘aaa’
自定义异常:
raise
tushare
#1.读取所有上市股票的信息
import tushare as ts
pro = ts