Câu hỏi về Python

Câu hỏi về Python

9th Grade

20 Qs

quiz-placeholder

Similar activities

Python Basics 2

Python Basics 2

9th - 12th Grade

20 Qs

Programmer OK9

Programmer OK9

1st - 10th Grade

15 Qs

6.1 Guided Notes - Dictionary and Data Structures Quiz

6.1 Guided Notes - Dictionary and Data Structures Quiz

9th Grade

15 Qs

Electronic Components

Electronic Components

9th - 12th Grade

20 Qs

ÔN TẬP GIỮA KÌ 1 TIN 9

ÔN TẬP GIỮA KÌ 1 TIN 9

9th Grade

20 Qs

Unit 6 and 7 review

Unit 6 and 7 review

9th Grade

17 Qs

Y9 List Introduction

Y9 List Introduction

9th Grade

18 Qs

Python (Objects)

Python (Objects)

6th - 12th Grade

18 Qs

Câu hỏi về Python

Câu hỏi về Python

Assessment

Quiz

Computers

9th Grade

Medium

Created by

nhut huynh

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Cách nào sau đây để tạo danh sách trong Python?

my_list = {1, 2, 3}

my_list = [1, 2, 3]

my_list = (1, 2, 3)

my_list = "<1, 2, 3>"

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để thêm một phần tử vào danh sách foods, ta dùng phương thức nào?

foods.add("Pizza")

foods.insert("Pizza")

foods.append("Pizza")

foods.put("Pizza")

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào giúp thay đổi phần tử tại vị trí index trong danh sách colors?

colors(index) = "Đỏ"

colors[index] = "Đỏ"

colors.replace(index, "Đỏ")

colors.change(index, "Đỏ")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để xóa phần tử có giá trị "Mèo" khỏi danh sách animals, ta dùng?

animals.pop("Mèo")

animals.delete("Mèo")

animals.remove("Mèo")

animals.erase("Mèo")

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Kết quả của đoạn code sau là gì? numbers = [3, 7, 9] for i, num in enumerate(numbers): print(i, num)

Lỗi cú pháp

In ra từng số nhưng không có chỉ mục

In ra cả chỉ mục và số

Chỉ in số cuối cùng

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để tạo dictionary lưu thông tin sách, ta dùng cách nào?

book = ["title": "Python", "author": "Guido"]

book = {"title": "Python", "author": "Guido"}

book = ("title", "Python", "author", "Guido")

book = ["title", "Python", "author", "Guido"]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để thêm cặp "Alice": "0987654321" vào danh bạ contacts, ta dùng?

contacts.add("Alice", "0987654321")

contacts.insert("Alice", "0987654321")

contacts["Alice"] = "0987654321"

contacts.put("Alice", "0987654321")

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?