2018 2018春 Python语言程序设计(天津大学仁爱学院)(中国高校计算机教育MOOC联盟) 最新满分章节测试答案
本答案对应课程为:点我自动跳转查看
本课程起止时间为:2018-03-05到2018-06-30
本篇答案更新状态:已完结
【第1周】Python编程之基本方法 第1讲单元测验
1、 问题:下列采用编译执行的编程语言是___
选项:
A:C语言
B:PHP语言
C:Java语言
D:Python语言
答案: 【C语言】
2、 问题:下列代码为正确的是__(1)print("Programming is fun") print("Python is fun")(2)print("Programming is fun") print("Python is fun")(3)print("Programming is fun) print("Python is fun")(4) print("Programming is fun) print("Python is fun")
选项:
A:(1)
B:(2)
C:(3)
D: (4)
答案: 【(2)】
3、 问题:Python语言中注释行使用下列______符号标注
选项:
A://
B:/*
C:#
D:$$
答案: 【#】
4、 问题:若将一段Python代码进行注释,使用下列______符号标注
选项:
A:/# 程序代码段 #/
B:// 程序代码段 //
C:”’ 程序代码段 ”’
D:" 程序代码段 "
答案: 【”’ 程序代码段 ”’】
5、 问题:当程序执行过程中未出现任何错误,但不能实现它原来打算要完成的任务,这种错误被称之为______
选项:
A:语法错误
B:运行错误
C:逻辑错误
D:没有任何错误
答案: 【逻辑错误】
6、 问题:利用Turtle绘制一个半径为50的圆,使用下列哪个__命令
选项:
A:turtle.circle(50)
B:turtle.circle(100)
C:turtle.drawcircle(50)
D:turtle.drawCircle(50)
答案: 【turtle.circle(50)】
7、 问题:在Python语言中,使用下列___函数接收用户从键盘输入的数据
选项:
A:enter()
B:eval()
C:input()
D:get()
答案: 【input()】
8、 问题:如果用户回车换行输入1 2 3,运行下列程序代码时,其结果为______print("Enter three numbers: ")number1 = eval(input())number2 = eval(input())number3 = eval(input())average = (number1 + number2 + number3) / 3print(average)
选项:
A:1.0
B:2.0
C:3.0
D:4.0
E:运行错误
答案: 【2.0】
9、 问题:如果用户在同一行输入1 2 3,运行下列程序代码时,其结果为_print("Enter three numbers: ")number1 = eval(input())number2 = eval(input())number3 = eval(input())average = (number1 + number2 + number3) / 3print(average)
选项:
A:1.0
B:2.0
C:3.0
D:4.0
E:运行错误
答案: 【运行错误】
10、 问题:如果用户在同一行输入1,2, 3,运行下列程序代码时,其结果为_____number1, number2, number3 = eval(input("Enter three numbers: "))average = (number1 + number2 + number3) / 3print(average)
选项:
A:1.0
B:2.0
C:3.0
D:4.0
E:运行错误
答案: 【2.0】
11、 问题:设置Turtle画笔速度为5,使用下列______命令
选项:
A:turtle.speed(5)
B:turtle.setSpeed(5)
C:turtle.setspeed(5)
D:turtle.velocity(5)
答案: 【turtle.speed(5)】
12、 问题:下列两个代码输出的结果相同_代码1:print("3.54/2-2.5")代码2:print(3.54/2-2.5)
选项:
A:正确
B:错误
答案: 【错误】
13、 问题:Python源代码是不区分大小写。
选项:
A:正确
B:错误
答案: 【错误】
14、 问题:Python语言是一种解释性的语言,即脚本语言,这就意味着程序代码在执行过程是被解释器_______.
答案: 【翻译和执行】
15、 问题:标识符是由字母、_和下划线构成的字符序列。
答案: 【数字】
16、 问题:Python语言允许采用大小字母、数字、下划线等字符组合作为变量名,但不允许变量名首字符为数字,中间不能出现_。
答案: 【空格】
【第3周】Python编程之数据类型 第3讲 单元测验
1、 问题:将数字2454.8692格式化成宽度为7,小数点后保留两位的形式,即2454.87,应使用下列哪个语句_______
选项:
A:print("{0:7.2f}".format(2454.8692))
B:print("{ }".format(2454.87)}
C:print("{0:7.2f}".format(2454.87))
D:print("{7.2f}".format(2454.8692))
答案: 【print("{0:7.2f}".format(2454.8692))】
2、 问题:执行下列程序,补充输出语句,以实现将输出形式为: 工资总额:3312.56hourlyday=7.5
hourlypay=19.63
totalwork=22.5
salary=hourlypayhourlydaytotalwork
选项:
A:print("{0:7.2f}".format("工资总额:",salary))
B:print("{0},{1:7.2f}".format("工资总额:",salary))
C:print("{1:7.2f}".format("工资总额:",salary))
D:print("{ },{0:7.2f}".format("工资总额:",salary))
答案: 【print("{0},{1:7.2f}".format("工资总额:",salary))】
3、 问题:执行下列程序,程序输出结果分别是____ (说明:答案中每个?代表一个空格)s = "Welcome our University"
print(s[3:])
print(s[3:5]+s[-5:-2])
print("{:>25}".format(s))
选项:
A:come our Universitycorsi???Welcome our University
B:come our UniversitycorsiWelcome our University
C:come our UniversitycorsiWelcome our University?????
D:come our Universitycorsi?????Welcome our University
答案: 【come our Universitycorsi???Welcome our University】
4、 问题:执行下列程序,程序输出结果分别是____ (说明:答案中每个?代表一个空格)s = "Welcome our University"
print(s[:8])
print("{0:>20}".format(s[:8]))
print("{0:-^20}".format(s[:8]))
print("{0:<20}".format(s[:8])
选项:
A:Welcome?????????????WelcomeWelcome————-Welcome?????????????
B:Welcome?????????????Welcome————-Welcome?????????????Welcome
C:Welcome?????????????Welcome——Welcome——-Welcome?????????????
D:WelcomeWelcomeWelcomeWelcome
答案: 【Welcome?????????????Welcome——Welcome——-Welcome?????????????】
5、 问题:执行下列程序,程序输出结果分别是____for i in range(5):
print("{:2}".format(i))
选项:
A:01234
B:0 1 2 3 4
C:1 2 3 4 5
D:01234
答案: 【01234】
6、 问题:执行下列程序,程序输出结果分别是____for i in range(5):
print("{:2}".format(i),end=’ ‘)
选项:
A:01234
B:12345
C:0 1 2 3 4
D:01234
答案: 【0 1 2 3 4】
7、 问题:字符串是一个字符序列,例如,字符串s,从右侧向左第3个字符用什么索引?
选项:
A:s[3]
B:s[-3]
C:s[0:-3]
D:s[:-3]
答案: 【s[-3]】
8、 问题:获得字符串s长度的方法是什么?
选项:
A:s.len()
B:s.length
C:len(s)
D:length(s)
答案: 【len(s)】
9、 问题:字符串函数strip()的作用是什么?
选项:
A:按照指定字符分割字符串为数组
B:连接两个字符串序列
C:去掉字符串两侧空格或指定字符
D:替换字符串中特定字符
答案: 【去掉字符串两侧空格或指定字符】
10、 问题:执行下列代码,程序输出结果是_x =0
if x < 4:
x = x +1
print("x is", x)
选项:
本文章不含期末不含主观题!!
本文章不含期末不含主观题!!
支付后可长期查看
有疑问请添加客服QQ 2356025045反馈
如遇卡顿看不了请换个浏览器即可打开
请看清楚了再购买哦,电子资源购买后不支持退款哦