
青少年软件编程(Python-3)202206
Authored by 子明 高
Information Technology (IT)
7th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
38 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
如下所示的2行代码,最后print()函数打印出来的结果是?( ) c = [['赵大',21,'男','北京'],['钱二',20,'男','西安'],['孙三',18,'女','南京'],['李四',20,'女','杭州']] print(c[1][3])
男
北京
西安
女
2.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
要读取下图“书目.csv”文件的全部内容,小明编写了后面4行代码。请问,红色①处,应该填写哪种打开模式?( ) f = open("书目.csv" , ① ) a = f.read() print(a) f.close
"w"
"a"
"r"
"a+"
3.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
下图所示,有一个名为"书目.csv"的文件。小明针对这个文件编写了5行代码,请问,代码运行到最后打印在屏幕上的结果是?( ) with open('书目.csv', 'r', encoding='utf-8') as f: for line in f.readlines(): a = line.split(",") if a[0] == "水浒传" : print(a[1])
老残游记
172
55
70
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
小明编写了下列4行代码,请问,代码运行到最后,屏幕上打印出来的结果是?( ) a = ['a','b','c'] b = [1,2,3] c = [b,a] print(c[1][0])
1
a
'1'
'a'
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
下图左边的“身体素质.csv”文件,要打印成下图右边的效果,每个字段之间相隔一个TAB键的距离。小明编写了如下代码,请选择:代码中横线处的内容?( ) f = open('身体素质.csv', 'r') a = [] for i in f: a.append(i.strip('\n').split(',')) f.close for x in a: line='' for y in x: line += '{ } '.format(y) print(line)
\t
\n
\a
\r
6.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
在Python异常处理结构中,如果程序执行没有遇到异常(错误),不会执行什么关键字后面的语句体?( )
try
except
else
finally
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
运行下列程序,输出的结果是?( ) try: a=int(input()) b=int(input()) r=a/b print('商是:',r) except: print('错误') else: print('正确') finally: print('结束') 当输入: 16 8
错误
商是: 2.0 正确
商是: 2 正确 结束
商是: 2.0 正确 结束
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
5 questions
Legends, Leaders, & Changemakers: Maya Angelou
Interactive video
•
6th - 8th Grade
22 questions
distributive property
Quiz
•
7th Grade
10 questions
Understanding Poetry and Literary Devices
Interactive video
•
4th - 8th Grade
20 questions
Ethos, Pathos, Logos Practice
Quiz
•
6th - 7th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Main Idea and Supporting Details
Quiz
•
7th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade