青少年软件编程(Python-2)202203

青少年软件编程(Python-2)202203

5th Grade

37 Qs

quiz-placeholder

Similar activities

Quiz tentang Microsoft Office

Quiz tentang Microsoft Office

5th Grade

42 Qs

Computing

Computing

5th Grade

40 Qs

青少年软件编程(Python-2)202203

青少年软件编程(Python-2)202203

Assessment

Quiz

Information Technology (IT)

5th Grade

Hard

Created by

子明 高

FREE Resource

37 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

关于Python中的列表,下列描述错误的是?( )

列表是Python中内置可变序列,是若干元素的有序集合;

列表中的每一个数据称为"元素";

在Python中,一个列表中的数据类型可以各不相同;

可以使用s[1]来获取列表s的第一个元素。

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

已知列表a=[1,3,5,7],下列语句无法将a变成a=[1,3,5,7,9]的是?( )

a.append(9)

a=[1,3,5,7,9]

a.insert(4,9)

a[4]=9

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

关于以下代码段的说法错误的是?( ) a = [1, 2, 5, 4, 3] a.sort(reverse=True) print(a)

a.sort(reverse=True)语句中的reverse默认值为False。

省略a.sort(reverse=True)语句中的reverse=True,代码运行结果不变。

将以上代码的a.sort(reverse=True)改为a=sorted(a,reverse=True),代码运行结果和原题的结果一样。

以上代码运行结果为:[5, 4, 3, 2, 1]。

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

下面程序的运行结果是?( ) a=80 b=70 if a>b: a,b=b,a print(a,b)

70 70

80 70

70 80

80 80

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

以下关于元组的描述正确的是?( )

元组和列表相似,所有能对列表进行的操作都可以对元组进行

创建元组时,若元组中仅包含一个元素,在这个元素后可以不添加逗号

元组中的元素不能被修改

多个元组不能进行连接

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

以下程序的输出结果是?( ) tuple1 = (1,2,3) tuple2 = (2) print(tuple1*tuple2)

(1,2,3)

(1,2,3,1,2,3)

(2,4,6)

报错

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

以下代码的输出结果是?( ) ls = [] for m in '想念': for n in '家人': ls.append(m+n) print(ls)

["想念","家人"]

["想想","念念","家人"]

["想家想","人念家","念人"]

["想家", "想人", "念家", "念人"]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Information Technology (IT)