Search Header Logo

2-列表与元组

Authored by Yilin Chen

Computers

University

Used 5+ times

2-列表与元组
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

下面属于可变变量的是?

int

string

list

tuple

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

已知列表A=[1,2,3,4],请问A[1]和A[-1]的值分别为:

1,4

2,3

1,3

2,4

3.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

已知列表A=[1,2,3,4,5],我们想要将列表中的元素 3 删除,下列操作错误的是:

A.pop(2)

del A[3]

A.remove(3)

del A[2]

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

已知列表A=[1,2,3,4],我们想要向列表中添加元素 5 得到列表[1,2,3,4,5],下列操作错误的是:

A.append(5)

A+[5]

A.extend([5])

A.insert(5)

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

已知列表A=[1,2,4,5],我们想要向列表中添加元素 3 得到列表[1,2,3,4,5],下列操作正确的是:

A.append(2,3)

A.append(3,2)

A.insert(2,3)

A.insert(3,2)

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

对列表经过一系列的切片操作后,输出的结果为:

[3,2]

[1]

[2]

[3]

7.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

对列表进行下列操作后,输出结果为:

A=[1,2,3]

A.insert(3,2)

A.append(4)

A.sort()

print(A)

[1,2,2,3,4]

[1,2,3,3]

[2,2,3,4]

None

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?