
83 3 ** 2 ___ 9
84 3 * 2 _6
85 x = [3, 5, 7] x[10:] __ []
86 x = [3, 5, 7] x[len(x):] = [1, 2] x ____[3, 5, 7, 1, 2]
87 x = [3, 7, 5] x.sort(reverse=True) x _______ [7, 5, 3]
88 x = [3, 7, 5] x = x.sort(reverse=True) x ___ None
89 x = [1, 11, 111] x.sort(key=lambda x: len(str(x)), reverse=True) x ________
[111, 11, 1]
90 list(zip([1,2], [3,4])) ______________ [(1, 3), (2, 4)]
91 x = [1, 2, 3, 2, 3] x.pop() x ___ [1, 2, 3, 2]
92 list(map(list,zip(*[[1, 2, 3], [4, 5, 6]]))) ______ [[1, 4], [2, 5], [3, 6]]
93 [x for x in [1,2,3,4,5] if x<3] ___________ [1, 2]
94 [index for index, value in enumerate([3,5,7,3,7]) if value == max([3,5,7,3,7])] ________ [2, 4]
95 x = [3,5,3,7] [x.index(i) for i in x if i==3] ____ [0, 0]
96 x = [1, 2] list(enumerate(x)) _____ [(0, 1), (1, 2)]
97 vec = [[1,2], [3,4]] [col for row in vec for col in row] ________________ [1, 2, 3, 4]
98 vec = [[1,2], [3,4]] [[row[i] for row in vec] for i in range(len(vec[0]))] _______________
[[1, 3], [2, 4]]
99 x = list(range(10)) x[-4:] ____ [6, 7, 8, 9]
100 path = r c:test.html path[:- 4]+ htm ____ c:test.htm
101 x = [3, 5, 7] x[1:] = [2] x ______ [3, 2]
102 x = [3, 5, 7] x[:3] = [2] x ______ [ 2]
103 x y = x[:] id(x[0]) == id(y[0]) ____ True
104 x = [1, 2, 3, 2, 3] x.remove(2) x __ [1, 3, 2, 3]
105 3<<2 _____ 12
106 65 >> 1 ___ 32
107 chr(ord( a)^32) _ A
108 chr(ord( a-32) _ A
109 abs(3+4j) __5.0
110 callable(int) _ True
111 list(str([1,2,3])) == [1,2,3] ____ False
112 str([1, 2, 3]) ________ [1, 2, 3]
113 str((1, 2, 3)) ________ (1, 2, 3)
114 Python ____ ___ andor not
115 Python 3.x for i in range(3):print(i, end= , ) ___________ 0,1,2,
116 Python 3.x print(1, 2, 3, sep= , ) ______ 1,2,3
117 else for while __( ) else
118 ____ break
119 _ continue
120 sum(range(1, 10, 2)) __ 25
121 sum(range(1, 10)) ___ 45
122 %c%65 ___ A
123 %s%65 ____ 65
评论0
最新资源