没有合适的资源?快使用搜索试试~ 我知道了~
首页(完整版)python考试复习题库.pdf
(完整版)python考试复习题库.pdf
需积分: 39 223 下载量 53 浏览量
更新于2023-03-03
评论 16
收藏 170KB PDF 举报
一、 填空题 1、 Python安装扩展库常用的是_工具。(pip) 2、 Python标准库math中用来计算平方根的函数是____。(sqrt) 3、 Python程序文件扩展名主要有__和两种,其中后者常用于GUI程序。(py、pyw) 4、 Python源代码程序编译后的文件扩展名为___。(pyc)
资源详情
资源评论
资源推荐
1 Python _ pip
2 Python math ____ sqrt
3 Python __ GUI pypyw
4 Python ___ pyc
5 pip numpy _______ pip install upgrade numpy
6 pip Python ___pip list
7 IDLE ____ Alt+P
8 pip Python ___ pip list
9 Python ____ None
10 Python ___ ( )
11 Python ______ type()
12 Python _______ id()
13 3 4 Python ___3+4j 3+4J
14 Python ___ //
15 Python _ |
16 A B _ A < B
17 [1, 2, 3]*3 ____________ [1, 2, 3, 1, 2, 3, 1, 2, 3]
18 list(map(str, [1, 2, 3])) ___________ [ 1, 2, 3
19 x = 3==3, 5 x ___ (True, 5
20 x = 3 x += 6 x _____ 9
21 x = 3 id(x) 496103280 x += 6 id(x) == 496103280
_ False
22 x = 3 x *= 6 x ______ 18
23 Python Python ____ pyc
24 [3] in [1, 2, 3, 4] ______ False
25 sort() None
26 aList [3, 4, 5, 6, 7, 9, 11, 13, 15, 17] aList[3:7] ____________ [6, 7,
9, 11]
27 10 5 _____ [5 for i in range(10)]
28 a = [ name, age, sex b = [ Dong, 38, Male
a b ___________ c = dict(zip(a, b))
29 Python __ -1
30 Python .join(list( hello world! )) __________ hello world!
31 n _________
32 Python list(range(1,10,3)) _________ [1, 4, 7]
33 list(range(5)) ______ [0, 1, 2, 3, 4]
34 ____ del
35 a = [1, 2, 3] b = [1, 2, 4] id(a[1])==id(b[1]) _ True
36 int( 123, 16) ___ 291
37 int( 123, 8) ___ 83
38 int( 123) ___ 123
39 int( 101,2) ____ 5
40 abs(-3) _ 3
41 list(range(6))[::2] ______ [0, 2, 4]
42 x 3 ___ x[0:0] = [3]
43 sorted([1, 2, 3], reverse=True) == reversed([1, 2, 3]) ___ False
44 ab in acbed __ False
45 Python 3.x print(1, 2, 3, s ep=: ) __ 1:2:3
46 sorted([111, 2, 33], key=lambda x: len(str(x))) ______ [2, 33, 111]
47 n n&1 == n%2 ___ True
48 int(4**0.5) __ 2
49 sorted([111, 2, 33], key=lambda x: -len(str(x))) __ [111, 33, 2]
50 Python ___ range len()
51 Python __ max()
52 Python __ min()
53 Python ______ sum()
54 x = [ 11, 2, 3 max(x) _ 3
55 min([ 11, 2, 3]) _______ 11
56 x = [ 11, 2, 3 max(x, key=len) _ 11
57 x = (3,) x _____ (3,)
58 x = (3) x ______ 3
59 x=3 y=5 x, y = y, x x __ 5
60 _____ globals()
61 _________ locals()(
62 __ __
63 _
None get()
64 ___ - items()
65 __ keys()
66 ____ values()
67 x = {1:2} x[2] = 3 x ______ {1: 2, 2: 3}
68 {1, 2, 3, 4} - {3, 4, 5, 6} ________ {1, 2}
69 set([1, 1, 2, 3]) __________ {1, 2, 3}
70 ____ in
71 100 13 _________________________ [i for i in
range(100) if i%13==0]
72 3<5>2 _____ True
73 x = { a: b, c: d a in x ____ True
74 x = { a: b, c: d b in x ____ False
75 x = { a: b, c: d b in x.values() ____ True
76 1<2<3 ___ True
77 3 or 5 __3
78 0 or 5 ___5
79 3 and 5 __ 5
80 3 and not 5 ____ False
81 3 | 5 ____ 7
82 3 & 6 ___ 2
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
124 %d,%c % (65, 65) __ 65,A
125 The first:{1}, the second is {0} .format(65,97) ____________________ The first:97, the second
is 65
126 {0:#d},{0:#x},{0:#o} .format(65) ___ 65,0x41,0o101
127 isinstance( abcdefg , str) __ True
128 isinstance( abcdefg , object) ___ True
129 isinstance(3, object) ___True
130 abcabcabc.rindex( abc) __6
131 : .join( abcdefg .split( cd)) ____ ab:efg
132 Hello world. I like Python. .rfind( python ) __-1
133 abcabcabc.count( abc) ___ 3
134 apple.peach,banana,pear .find( p) ____ 1
135 apple.peach,banana,pear .find( ppp) __ -1
136 abcdefg .split( d) ________ [ abc, efg
137 : .join( 1,2,3,4,5 .split( , )) ________ 1:2:3:4:5
138 , .join( a b cccnddd .split()) ____ a,b,ccc,ddd
139 Hello world .upper() _ HELLO WORLD
140 Hello world .lower() ___ hello world
141 Hello world .lower().upper() _ HELLO WORLD
142 Hello world .swapcase().swapcase() ____ Hello world
143 r c: notepad.exe .endswith( .exe ) ___ True
144 r c: notepad.exe .endswith(( .jpg , .exe )) _True
145 C: notepad.exe .startswith( C:) ___ True
146 len( Hello world! .ljust(20)) ___ 20
147 len( abcdefg .ljust(3)) ___ 7
148 len([i for i in range(10)]) ____ 10
149 len(range(1,10)) ___ 9
150 range(10)[-1] __ 9
151 range(10,20)[4] ____ 14
152 round(3.4) _3
153 round(3.7) ___ 4
154 a + b ___ ab
155 x = 123 y = 456 x + y ____ 123456
156 a.join( abc.partition( a)) ______ aaabc
157 re.spl it( .+, alpha.beta gamma..delta ) _____________ [ alpha , beta, gamma, delta
158 x = a234b123c re re.split( d+, x) _______ [ a, b, c
159 .join( asdssfff .split( sd)) __assfff
160 .join(re.split( [sd] , asdssfff )) _____ afff
161 re re.findall( 1+, 33abcd112) _________ [ 3, 1
162 print(re.match( abc, defg)) ___ None
163 Hello world! -4] ______ r
164 Hello world! -4:] ______ rld!
165 test.py .endswith(( .py , .pyw)) ____ True
166 x = (3) x * 3 ____ 9
167 x = (3,) x * 3 ___ (3, 3, 3)
168 len( abc.ljust(20)) ____ 20
169 print(re.match( ^[a-zA- Z]+$, abcDEFG000)) ___ None
170 rR
171 _ (*+?{n}{n,}{n,m})
?
172 re re.sub( d+, 1, a12345bbbb67c890d0e) ___________
a1bbbb1c1d1e
173 x = [1, 1, 1] id(x[0]) == id(x[2]) ___ True
174 x = list(range(10)) del x[::2] x ___ [1, 3, 5, 7, 9]
175 x = [1, 2, 3, 4] del x[1] x __ [1, 3, 4]
176 [1] * 2 _______ [1, 1]
177 [1, 2] * 2 ____ [1, 2, 1, 2]
178 x = [1, 2, 3] x.insert(1, 4) x _ [1, 4, 2, 3]
179 x = [1, 2, 3] x.insert(0, 4) x _ [4, 1, 2, 3]
180 x = [1, 2, 3] x.pop(0) x ___ [2, 3]
181 x = [[1]] * 3 x[0][0] = 5 x ______ [[5], [5], [5]]
182 list(map(lambda x: x+5, [1, 2, 3, 4, 5])) ____________ [6, 7, 8, 9, 10]
183 {1, 2, 3, 4, 5} ^ {4, 5, 6, 7} _______________ {1, 2, 3, 6, 7}
184 5 if 5>6 else (6 if 3>2 else 5) ___ 6
185 x = [1, 2, 3] x[len(x)-1:] = [4, 5, 6] x _______________________ [1,
2, 4, 5, 6]
186 len(range(1, 10)) _ 9
187 len( .encode( utf-8)) _ 6
188 len( .encode( gbk)) __ 4
189 chr(ord( A)+2) ____C
190 x y = x[:] id(x) == id(y) _ False
191 sorted([13, 1, 237, 89, 100], key=lambda x: len(str(x))) _________________________ [1, 13,
89, 237, 100]
192 Python _______ def
193 ______ global
194 return return _______ None
195 sum(range(10)) ______ 45
196 sum(range(1, 10, 2)) __ 25
197 abcab.replace( a, yy) _ yybcyyb
198 table = .maketrans( abcw, xyzc Hellow world .translate(table) ____________
Helloc corld
199 hello world, hellow every one .replace( hello , hi ) ______________ hi world, hiw every one
200 x = hello world x.replace( hello , hi ) x __ hello world
201 __ 1 +
202 x = a b c d , .join(x.split()) _ a,b,c,d
203 __ 0 *
204 abcab.strip( ab) ____ c
205 [str(i) for i in range(3)] __ [ 0, 1, 2
剩余25页未读,继续阅读
a903265446
- 粉丝: 17
- 资源: 233
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- stc12c5a60s2 例程
- Android通过全局变量传递数据
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0