Search Header Logo

11_OntapGHK2.cd

Authored by Phong Thanh

Computers

1st Grade

Used 7+ times

11_OntapGHK2.cd
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

110 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh nào được dùng để mở tệp “data.txt” chỉ để đọc dữ liệu trong Python?

open("data.txt","w")

open("data.txt","r")

open("data.txt","a")

open("data.txt","x")

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào dùng để đóng tệp đã mở trong Python?

close("file.txt")

file.close()

file.shutdown()

shutdown(file)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào dùng để đọc tất cả nội dung từ tệp “file.txt” và lưu vào một chuỗi?

file.readlines()

file.readline()

file.read()

file.split()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để lấy các phần tử có chỉ số lẻ từ danh sách a, ta sử dụng lệnh nào?

a[::2]

a[::-1]

a[1::2]

a[1:]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Phương thức sort() trong danh sách ds.sort() làm gì?

Đảo ngược danh sách

Sắp xếp danh sách theo thứ tự tăng dần

Xóa tất cả các phần tử trong danh sách

Sao chép danh sách

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lệnh nào sẽ chèn một phần tử x vào vị trí chỉ số y trong danh sách ds?

ds.insert(y, x)

ds.append(x, y)

ds.add(y, x)

ds.insert(x, y)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Câu lệnh nào lấy các phần tử từ chỉ số 2 đến chỉ số 5 trong danh sách a?

a[2:5]

a[2:6]

a[3:6]

a[2::5]

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?