报名本机构合作学校,赠送复习资料,复习课程,确保录取。并且可以申请学校奖学金500元~1500元不等!
ython快速入门-安康学院[火
测验1:下列哪些能力是计算机擅长而人类不擅长的?
1、【多选题】下列哪些能力是计算机擅长而人类不擅长的?
A、推理
B、计算
C、记忆
D、抽象
测验2
1、【多选题】和高级语言相比,汇编语言有哪些优缺点?
A、占用内存少
B、执行速度快
C、编程难度低
D、可移植性好
2、【多选题】和自然语言相比,编程语言有哪些特点?
A、更容易为计算机“理解”
B、语义明确、无歧义性
C、表达能力更强
D、更易学
测验3:下列代码运行时不会产生错误的是?
1、【单选题】下列代码运行时不会产生错误的是?
A、print 'Hi, I'm fine'
B、print "Hi, I'm fine"
C、print 'Hi, I'm fine"
D、print "Hi, I'm fine'
第一周作业
第一周测验
1、【单选题】0
0
1
3
23
Stanford
1
1
25
14.0Normal
0
false
false
false
EN-US
JA
X-NONE/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}计算机为什么采用二进制,而非十进制作为数制的基础?
A、因为二进制数更容易被硬件存储和计算
B、因为二进制比十进制表示能力更强
C、因为二进制比十进制计算速度快
D、因为二进制数精度更高
2、【单选题】0
0
1
3
22
Stanford
1
1
24
14.0Normal
0
false
false
false
EN-US
JA
X-NONE/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}关于Python语言的执行过程,描述正确的是?
A、由解释器一条语句一条语句地执行
B、由编译器将源程序转化为机器语言,然后执行
C、执行过的语句将不会再被执行
D、可以同时执行多条语句
3、【单选题】下列Python程序,没有错误的是?
A、print('Hello, I\'m Tom.')
B、Print('Hello, World!')
C、print('Hello, this's Tom.')
D、print('Hello, ' print 'World!')
4、【单选题】在Spyder IDE中编写Python程序,输出“Hello World”,要求将这两个单词分两行输出,以下哪个程序不正确?
A、print ('Hello
World')
B、print("Hello\nWorld")
C、print('Hello')
print('World')
D、print('Hello\nWorld')
5、【单选题】0
0
1
3
21
Stanford
1
1
23
14.0Normal
0
false
false
false
EN-US
JA
X-NONE/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Cambria;
mso-ascii-font-family:Cambria;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Cambria;
mso-hansi-theme-font:minor-latin;}Python语言为什么被称为高级程序设计语言?
A、因为它比低级语言更抽象
B、因为它比低级语言功能强大
C、因为它比低级语言更复杂
D、因为它是解释型语言
E、因为它是编译型语言
测验1
1、【单选题】下列语句执行的结果是?int('hello')
A、0
B、1
C、100
D、程序出错
2、【单选题】八进制数 036,相当于十六进制的多少?提示:查找 oct、hex 等相关函数及其用法
A、0x36
B、0x16
C、0x1e
D、0x20
3、【单选题】下列语句执行的结果是?'hello' - 'world'
A、helloworld
B、hello world
C、52473
D、程序出错
测验1
1、【填空题】下列语句的输出结果是?(2**2)**3
A、
2、【填空题】下列语句的输出结果是?'abc' * 3
A、
3、【填空题】下列语句的输出结果是?2**2**3
A、
测验2
1、【单选题】和下列语句等价的是?not (x or y)
A、not x and not y
B、not x or not y
C、not x or y
D、not x and y
2、【单选题】下列语句的输出结果是?123 and 456
A、123
B、456
C、Ture
D、False
测验3
1、【判断题】判断闰年的方式是否可以写成:y % 400 == 0 or y % 4 == 0 and y % 100 != 0
A、正确
B、错误
2、【判断题】判断闰年的方式是否可以写成:y % 4 == 0 and y % 100 != 0 or y % 400 == 0
A、正确
B、错误
测验1
1、【单选题】下列程序的执行结果为?x = 10
print type(x)
x = 10.0
print type(x)
x = '10.0'
print type(x)
A、<type 'int'>
<type 'float'>
<type 'str'>
B、<type 'int'>
<type 'int'>
<type 'int'>
C、<type 'str'>
<type 'str'>
<type 'str'>
D、程序出错
2、【单选题】若程序只有以下两行代码,则程序的执行结果为? x = y + 1
print x
A、1
B、输出一个随机值
C、2
D、程序出错
测验2
1、【单选题】执行下列语句,若输入为Hello\nWorld,则输出为?input = raw_input()
print input
A、Hello World
B、Hello
C、Hello\nWorld
D、World
2、【单选题】执行下列语句,若输入为123,则输出为?input = raw_input()
print input * 3
A、369
B、123123123
C、1233
D、程序出错
第二周作业
第二周测验
1、【单选题】执行下列语句,输出的结果是?x = 7.0
y = 5
print (x % y)
A、2.0
B、2
C、程序出错
D、1
E、1.0
2、【单选题】下列变量名中,符合命名规则的是:
A、*abc
B、1_first
C、_AKU_
D、print
3、【填空题】执行以下语句后的结果是:my_name = 'Alice'
print(len(my_name))
A、
4、【填空题】int(99.99)该语句执行的结果是:
A、
5、【填空题】执行以下代码的结果是:spam = 'hello'
spam + 'world'
print(spam)
A、
测验1
1、【单选题】如下图所示的流程图的输出结果是?<img src="http://img2.ph.126.net/Cejn48kM7u1bBWzQaT9Knw==/6619182045002868566.jpg" />
A、1
B、2
C、3
D、y
2、【单选题】下列关于流程线的说法不正确的是?
A、流程线无论什么方向,总要按箭头的指向执行;
B、流程线只要是上下方向就表示自上向下执行可以不要箭头;
C、流程线表示算法步骤执行的顺序,用来连接流程图图框;
D、流程线是带有箭头的线,它可以画成折线。
3、【填空题】阅读下面程序,最终的输出值是?var_A = 100
if var_A 60:
var_A += 10
else:
var_A -= 10
var_A += 3
print var_A
A、
测验2
1、【单选题】阅读下面程序,选择正确输出结果:x = 2
y = 4
if x 2:
if y 2:
z = x + y
print 'z is', z
else:
print 'x is', x
A、没有输出
B、z is 6
C、x is 2
D、程序出错
2、【单选题】阅读下面代码,选择正确的输出结果:grade = 97
if grade 60:
print 'E'
elif grade = 60:
print 'D'
elif grade = 70:
print 'C'
elif grade = 80:
print 'B'
elif grade = 90:
print 'A'
A、A
B、B
C、D
D、E
测验1
1、【判断题】下列求100以内所有偶数之和的程序是否正确?sum = 0
i = 0
while i 100:
if i % 2 == 0:
sum += i
i += 2
print sum
A、正确
B、错误
2、【判断题】下列求100以内所有奇数之和的程序是否正确?sum = 0
i = 1
while sum 100:
if i % 2 != 0:
sum += i
i += 2
print sum
A、正确
B、错误
测验2
1、【填空题】下列代码的输出结果是?num = 9
count = 0
while num 0:
if num % 2 == 0:
num /= 2
elif num % 3 == 0:
num /= 3
else:
num -= 1
count += 1
print count
A、
测验3
1、【填空题】下列程序的输出结果为?max = 10
sum = 0
extra = 0
for num in range(1, max):
if num % 2 and not num % 3:
sum += num
else:
extra += 1
print sum
A、
2、【填空题】以上题目,如将第11行,替换为:print extra则输出的结果为?
A、
3、【填空题】有多少个三位数字能被17整除?
A、
测验4
1、【判断题】此论断正确么?“凡是使用 while 循环实现的程序,都能用 for 循环改写。”
A、正确
B、错误
2、【判断题】下列程序一定会进入死循环:while True: for x in range(6): y = 2 * x + 1 if y 9: break
A、正确
B、错误
第三周作业
第三周测验
1、【单选题】以下程序的输出结果是?y = 0
for i in range(0, 10, 2):
y += i
print (y)
A、20
B、9
C、10
D、30
2、【单选题】以下程序的输出结果是?number = 30
if number % 2 == 0:
print (number, 'is even')
elif number % 3 == 0:
print (number, 'is multiple of 3')
A、30 is even
B、30 is even30 is multiple of 3
C、30 is multiple of 3
D、程序出错
3、【单选题】以下程序的输出结果是?x = 1
y = -1
z = 1
if x 0:
if y 0:
print ('AAA')
elif z 0:
print ('BBB')
A、无输出
B、AAA
C、BBB
D、语法错误
4、【填空题】如果输入4, -1, 6, 9, 8, 3, 0,请问以下程序的输出结果是?number = int(input('Enter an integer: '))
max = number
while number != 0:
number = int(input('Enter an integer: '))
if number max:
max = number
print (max)
A、
5、【填空题】Python语言中,if x 0:
y = 1
else:
y = -1等价于:y = 1 if x 0 else -1阅读下面代码,给出x结果:a = 3
b = 2
x = a if a b else b
A、
测验1
1、【单选题】下列程序的输出结果是?x = 1
def fun(x):
x = 2
fun(x)
print x
A、1
B、2
C、3
D、程序出错
2、【判断题】下列的说法是否正确:“使用函数一定会提高程序的执行效率。”
A、正确
B、错误
3、【判断题】下列说法是否正确:“使用函数总是可以减少程序的代码”
A、正确
B、错误
测验2
1、【单选题】定义如下的函数,下面哪种函数调用会出错 ?def defaultParameters(arg1, arg2=2, arg3=3):
print arg1, arg2, arg3
A、defaultParameters(10, arg3=10)
B、defaultParameters(arg3=10, arg1=10)
C、defaultParameters(10)
D、defaultParameters(arg2=10, arg3=10)
2、【填空题】下列程序的输出结果是:sum = 0
def sum(i1, i2):
result = 0
for i in range(i1, i2 + 1):
result += i
return result
print sum(1, 10)
A、
测验3
1、【单选题】下列程序的输出结果是:x = 1
y = 2
def swap(x, y):
t = x
x = y
y = t
print x, y
swap(x, y)
print x, y
A、1 21 2
B、2 11 2
C、1 22 1
D、2 12 1
2、【单选题】下列程序的输出结果是:x = 1
y = 2
def swap(a, b):
t = a
a = b
b = t
print a, b
swap(x, y)
print x, y
A、1 21 2
B、2 11 2
C、1 22 1
D、2 12 1
测验1
1、【单选题】下面关于递归函数说法正确的是:
A、递归函数的执行效率优于非递归函数
B、递归出口和递归关系是递归函数编写的关键
C、递归函数的嵌套调用次数没有限制
D、在能够使用递归函数的时候,尽量使用递归,因为它可以使得程序变得简洁,易于理解
2、【判断题】下列说法是否正确:“不使用递归函数,无法实现输出斐波那契数列的功能”
A、正确
B、错误
测验2
1、【单选题】下列递归函数的功能是:def convert(n):
if n == 0 or n == 1:
return n
else:
return convert(n / 2) * 10 + n % 2
A、求 0 到 n 的偶数和
B、将 n 转换为二进制数
C、求 0 到 n 的奇数和
D、将 n 转换为二进制数,然后再求逆序
测验3
1、【单选题】使用递归函数 fib(n) 求解斐波那契数列,则 fib(5) 共调用了几次 fib(2) ?
A、2
B、3
C、4
D、5
测验1
1、【单选题】下列语句没有错误的是?
A、'hello' + 3
B、'hello' * 3
C、'hello' * '3'
D、'hello' - '3'
2、【单选题】下面语句的输出结果是?range(len('Hello World'))
A、[1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11]
B、11
C、[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
D、[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
测验2
1、【单选题】若 s = 'Hello World',则执行 s.replace('o', 'b') 后,s 的内容是?
A、'Hellb Wbrld'
B、'Hellb World'
C、'Hello Wbrld'
D、'Hello World'
2、【多选题】给定字符串homebody,获取home的切片表达式为?
A、[:4]
B、[1:5]
C、[0:4]
D、[1:4]
测试3
1、【单选题】由字符串 s = 'hello world' 获得 'Hello World' 的方法为?
A、s.title()
B、s.capitalize()
C、s.upper()
D、s.isupper()
2、【单选题】若字符串 s = 'hello world',则语句 s.ljust(15, '.') 和 s.rjust(15) 的输出结果为?
A、'....hello world'' hello world'
B、'hello world....'' hello world'
C、'hello world....''hello world '
D、'hello world....''hello world'
3、【单选题】若字符串 s = 'hello world',则语句 s.count('l') 的输出结果为?
A、0
B、1
C、2
D、3
测验4
1、【单选题】下列代码的输出结果为?'{:.4e}'.format(234.56789)
A、'2.3456e+02'
B、'234.5679'
C、'2.3457e+02'
D、'2.345e+02'
2、【单选题】下列语句,返回值不为 None 的是?
A、print re.search('C.+A', 'ABCDEFBCDEF')
B、re.search('C.+A', 'ABCDEFABCDEF')
C、print re.search('C.A', 'ABCDEFABCDEF')
D、print re.search('C.A', 'ABCABCDEF')
测验1
1、【单选题】下列程序的输出结果是?a = [1, 2, 3]
print a * 2
A、[2, 4, 6]
B、[1, 2, 3, 1, 2, 3]
C、[11, 22, 33]
D、程序出错
2、【单选题】下列方法仅适用于列表,而不适用于字符串的是?
A、replace()
B、index()
C、find()
D、sort()
3、【单选题】关于列表,下面描述正确的是:
A、必须按顺序插入元素
B、可以不按顺序查找元素
C、所有元素类型必须相同
D、不支持 in 运算符
4、【填空题】下列程序的输出结果是?a = [1, 2, 3]
b = a
b[1] = 4
print a[1]
A、
测验2
1、【填空题】下列程序的输出结果是?提示:使用 http://www.pythontutor.com/ 网站观察程序执行的过程。def f(l):
l = [4, 5, 6]
return l
a = [1, 2, 3]
f(a)
print a[1]
A、
2、【填空题】下列程序的输出结果是?def f(l):
l[1] = [5]
return l
a = [1, 2, 3]
f(a)
print a[1]
A、
测验3
1、【单选题】算法A:在列表中找到首次出现的给定值算法B:在列表中找到所有出现过的给定值关于算法A和B的时间复杂度,下列说法正确的是:
A、算法A的时间复杂度大于算法B
B、算法A的时间复杂度小于算法B
C、算法A的时间复杂度等于算法B
D、无法比较它们的时间复杂度
2、【单选题】成员运算符 in 的时间复杂度是?
A、<img src="http://img0.ph.126.net/14UjVmsVX7VP63LVcxeLIA==/2164824045982605549.png" />
B、<img src="http://img2.ph.126.net/NOeIlef1tbfEWxHG0jY9jg==/6608269392097732547.png" />
C、<img src="http://img0.ph.126.net/nuNe6IVA5vszsvb_EnUHtg==/6619153457699923947.png" />
D、<img src="http://img1.ph.126.net/_azsBQeOF9AoWtgTMR8q0Q==/6608853232771275898.png" />
3、【单选题】在二分查找实现中,若将语句 low = mid + 1 和 up = mid - 1,分别改为 low = mid 和 up = mid ,则程序运行的结果有可能为?
A、还是能够找到待查找值的正确的位置
B、程序有可能进入死循环
C、找到的结果总是比想要的值大
D、找到的结果总是比想要的值小
4、【单选题】在二分查找实现中,若将语句 while low = up: ,改为 while low up: ,则程序运行的结果有可能为?
A、程序依然正确
B、程序出错
C、漏掉要查找的元素
D、程序死循环
5、【填空题】猜数字游戏中,假如猜测 1-1000 中的一个数字,采用折半猜测的方法,最多猜几次能猜到正确数字?
A、
测验4
1、【单选题】为什么通常冒泡排序法要快于选择排序法?
A、因为冒泡排序法通常执行的交换操作更少
B、因为冒泡排序法通常执行的比较操作更少
C、因为冒泡排序法循环的层数更少
D、因为冒泡排序法的代码量更少
2、【单选题】如果考虑到选择排序法的交换步骤,则该算法的时间复杂度为?
A、<img src="http://img1.ph.126.net/_azsBQeOF9AoWtgTMR8q0Q==/6608853232771275898.png" style="white-space: normal;" />
B、<img src="http://img2.ph.126.net/_TKUz-L3lks4WxGifCXTOw==/6608822446445701607.png" style="white-space: normal;" />
C、<img src="http://img2.ph.126.net/NOeIlef1tbfEWxHG0jY9jg==/6608269392097732547.png" style="white-space: normal;" />
D、<img src="http://img0.ph.126.net/b6PH31wnrUkckKfYsyps1Q==/6608884019096857233.png" style="white-space: normal;" />
3、【判断题】如果对一个已经按照从小到大排序的列表,使用冒泡排序法进行排序,则不需要进行一次循环即可完成排序。
A、正确
B、错误
4、【判断题】对选择排序法,一种可能的加速方法是:判断 min_index 和 i 是否相同,如果不相同再进行 lst[min_index] 和 lst[i] 的交换。
A、正确
B、错误
测验5
1、【填空题】下列表达式的返回结果是?[n*n for n in range(7) if n*n % 2 == 0]
A、
2、【填空题】给定列表 L = [1, 2, 3, 4],将列表转换为字符串 '1234',尝试使用表达式: ''.join([i for i in L])但不能正常工作。将其修改为正确的表达式为?
A、
测验1
1、【单选题】元组和列表都支持的方法是?
A、append()
B、find()
C、index()
D、remove()
2、【判断题】我们不能使用 sorted() 函数对一个元组进行排序。
A、正确
B、错误
测验1
1、【单选题】在一个字典中,查找一个键的速度和查找一个值的速度哪个更快?
A、值
B、一样快
C、键
D、无法比较
2、【单选题】下列关于字典性质描述正确的是?
A、可以直接根据键对字典进行排序
B、可以对键进行顺序查找
C、键可以重复
D、值可以重复
测验2
1、【单选题】下列语句,哪个不能够正确创建一个字典?
A、{[1, 2]:1, [3, 4]:3}
B、{'john':1, 'peter':3}
C、{1:'john', 3:'peter'}
D、{(1, 2):1, (3, 4):3}
2、【填空题】下列语句的输出结果是?d = { }
d['susan'] = 50
d['jim'] = 45
d['joan'] = 54
d['susan'] = 51
d['john'] = 55
print len(d)
A、
测验3
1、【单选题】下列语句,哪个不能创建一个集合?
A、set( )
B、(1, 2, 3)
C、set((1, 2, 3))
D、{1, 2, 3}
2、【多选题】下列语句,哪些不能正确创建一个集合?
A、{{1, 2}, {3, 4}}
B、{(1, 2), (3, 4)}
C、{[1, 2], [3, 4]}
D、{'12', '34'}
微信扫码添加好友
如二维码无法识别,可拨打 13662661040 咨询。