Search Header Logo

Kiểu danh sách Python

Authored by thuy ngan

Computers

10th Grade

Used 6+ times

Kiểu danh sách Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Câu 1. Để khai báo danh sách a và khởi tạo danh sách a có 3 phần tử 10, 20, 30, phương án nào sau đây đúng?

a = (10,20,30)

  1. a = {10,20,30}

  1. a = [10,20,30]

  1. a = 10,20,30

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Câu 2. Để khai báo danh sách a rỗng, phương án nào sau đây đúng?

  1. a ==[]

  1. a= 0

  1. a = []

  1. a = [0]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu 3. Để xuất phần tử cuối cùng trong danh sách a, phương án nào sau đây đúng?

  1. print(a[len(a)])

  1. print(len(a)-1)

  1. print(a[len(a)-1])

  1. print(len(a))

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Câu 4. Cho đoạn lệnh sau:

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

a.insert(2,9)

Danh sách a thu được là:

[5,9,7,3,4,1]

[5,7,9,3,4,1]

[5,7,3,4,1,2,9]

[2,9,5,7,3,4,1]

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Câu 5. Để xóa phần tử thứ 2 trong danh sách a ta dùng lệnh:

  1. del(a[2]) 

  1. del(a[1])

  1. remove(a[2])

  1. remove(a[1]) 

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Câu 6. Cho đoạn lệnh sau:

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

del(a[3])

Danh sách a thu được là:

  1. [7,8,1,9]

  1. [7,3,1,9]

  1. [7,3,8,9]

  1. [7,3,8,1]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu 7. Cho danh sách a = [1, 2, 3, 4, 5]. Lệnh nào dưới đây sẽ thêm số 6 vào danh sách a?

a.append(6)

a.insert(6)

a.add(6)

a.extend(6)

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers