我们可以通过如下重写代码来在代码中添加异常
a=[] foo = 'redbullz' try: for i in foo: a.append(i) print a[8] except Exception as e: print e
我们得到以下输出
list index out of range Process finished with exit code 0
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分