1 >>> ls1=["nihia"] 2 >>> ls1 3 ['nihia'] 4 >>> ls1.pop() 5 'nihia' 6 >>> ls1.append("sssss") 7 >>> ls1 8 ['sssss'] 9 >>> assert len(ls1)>0 10 >>> ls1.pop() 11 'sssss' 12 >>> assert len(ls1)>0 13 14 Traceback (most recent call last): 15 File " ", line 1, in 16 assert len(ls1)>0 17 AssertionError 18 >>> 19 >>> ls1.fishc 20 21 Traceback (most recent call last): 22 File " ", line 1, in 23 ls1.fishc 24 AttributeError: 'list' object has no attribute 'fishc' 25 >>> 26 >>> ms1[3] 27 28 Traceback (most recent call last): 29 File " ", line 1, in 30 ms1[3] 31 NameError: name 'ms1' is not defined 32 >>> ls1[3] 33 34 Traceback (most recent call last): 35 File " ", line 1, in 36 ls1[3] 37 IndexError: list index out of range 38 >>> 39 >>> dict1={'one':1 ,'two':2} 40 >>> dict1['one'] 41 1 42 >>> dict1['four'] 43 44 Traceback (most recent call last): 45 File " ", line 1, in 46 dict1['four'] 47 KeyError: 'four' 48 >>> dixt1.get('four') 49 50 Traceback (most recent call last): 51 File " ", line 1, in 52 dixt1.get('four') 53 NameError: name 'dixt1' is not defined 54 >>> dict1.get('four') 55 >>> dict1.get('two') 56 2 57 >>> 1+'1' 58 59 Traceback (most recent call last): 60 File " ", line 1, in 61 1+'1' 62 TypeError: unsupported operand type(s) for +: 'int' and 'str' 63 >>> 5/0 64 65 Traceback (most recent call last): 66 File " ", line 1, in 67 5/0 68 ZeroDivisionError: integer division or modulo by zero 69 >>> 70 >>> 71 >>> 72 >>> 73 >>> ================================ RESTART ================================ 74 >>> 75 76 Traceback (most recent call last): 77 File "/tmp/guest-WX48w4/文档/py1.py", line 2, in 78 file_name=open('myname') 79 IOError: [Errno 2] No such file or directory: 'myname' 80 >>> ================================ RESTART ================================ 81 >>> 82 83 Traceback (most recent call last): 84 File "/tmp/guest-WX48w4/文档/py1.py", line 2, in 85 file_name=open('myname.txt') 86 IOError: [Errno 2] No such file or directory: 'myname.txt' 87 >>> ================================ RESTART ================================ 88 >>> 89 wrong 90 [Errno 2] No such file or directory: 'myname.txt' 91 >>> ================================ RESTART ================================ 92 >>> 93 wrong 94 [Errno 2] No such file or directory: 'myname.txt' 95 >>> ================================ RESTART ================================ 96 >>> 97 98 Traceback (most recent call last): 99 File "/tmp/guest-WX48w4/文档/py1.py", line 2, in 100 name=a+'1'101 NameError: name 'a' is not defined102 >>> ================================ RESTART ================================103 >>> 104 wrong105 unsupported operand type(s) for +: 'int' and 'str'106 >>> ================================ RESTART ================================107 >>> 108 109 Traceback (most recent call last):110 File "/tmp/guest-WX48w4/文档/py1.py", line 2, in 111 int ('abc')112 ValueError: invalid literal for int() with base 10: 'abc'113 >>> ================================ RESTART ================================114 >>> 115 116 Traceback (most recent call last):117 File "/tmp/guest-WX48w4/文档/py1.py", line 5, in 118 print (file_name.read())119 NameError: name 'file_name' is not defined120 >>> 1/0121 122 Traceback (most recent call last):123 File " ", line 1, in 124 1/0125 ZeroDivisionError: integer division or modulo by zero126 >>> raise 1/0127 128 Traceback (most recent call last):129 File " ", line 1, in 130 raise 1/0131 ZeroDivisionError: integer division or modulo by zero132 >>>