
CP2-PTI
Quiz
•
Science
•
11th Grade
•
Practice Problem
•
Hard
Nguyễn Linh
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tại sao cần sử dụng định dạng JSON?
Vì JSON là một ngôn ngữ lập trình chuyên dụng, giúp tối ưu hóa hiệu suất hệ thống
Do JSON có cấu trúc dữ liệu phức tạp, giúp bảo vệ thông tin quan trọng
JSON là một định dạng dữ liệu nhẹ và dễ đọc, thích hợp cho việc truyền tải thông tin giữa các ứng dụng.
Vì JSON là ngôn ngữ dựa trên JavaScript, giúp tương thích tốt với nhiều ứng dụng web hiện đại.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Lệnh nào sau đây có tác dụng đọc file JSON trong Python?
readFile("data.json")
loadJSON("data.json")
parseJSON("data.json")
json.load(open("data.json")
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Khi nào cần thực hiện hàm ghi file JSON? Chọn đáp án đúng nhất.
Khi cần đọc dữ liệu từ chỉ một file JSON.
Mỗi khi danh sách đối tượng có thay đổi.
Khi muốn thay đổi nội dung của danh sách đối tượng.
Khi chỉ cần đọc dữ liệu mà không cần ghi lại.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong PyQt6, để thực hiện các thao tác thêm, xoá và sửa đổi dữ liệu trong một QListWidget, bạn sẽ sử dụng những phương thức nào?
addItem, removeItem, editItem
append, delete, modify
insertItem, takeItem, setItem
addEntry, removeEntry, updateEntry
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Để hiển thị danh sách các phần tử từ file dữ liệu lên giao diện ứng dụng. Bạn sẽ thực hiện các bước nào sau đây để đạt được mục tiêu này?
Kết nối với file dữ liệu, truy vấn dữ liệu và thêm từng mục vào QTableWidget bằng phương thức addItem.
Kết nối với file dữ liệu, truy vấn dữ liệu và thêm từng mục vào QListWidget bằng phương thức addItem
Chỉ cần tạo một QTableWidget và sau đó thêm các mục một cách bình thường với addEntry để hiển thị dữ liệu từ cơ sở dữ liệu.
Chỉ cần tạo một QListWidget và sau đó thêm các mục một cách bình thường với addEntry để hiển thị dữ liệu từ cơ sở dữ liệu
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đoạn code sau có vấn đề gì?
def initUI(self):
self.list_widget = QListWidget(self)
person_list = [ Person("John Doe", 25), Person("Jane Smith", 30), Person("Bob Johnson", 22) ]
for person in person_list:
item = QListWidgetItem(f"Name: {person.name}, Age: {person.age}") self.list_widget.addItem(item)
del person_list[0
Phải sử dụng addItems thay vì addItem.
Phải sử dụng lệnh pop thay vì lệnh del để xoá đối tượng.
Xóa đối tượng trong danh sách đối tượng nhưng chưa xoá trong QListWidget.
Không có vấn đề gì.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đoạn code sau có vấn đề gì?
def search(self):
search_anime_field = widgets.inputAnime.text()
if search_anime_field:
matched_items = widgets.animeList.findItems(search_anime_field, Qt.MatchFlag.MatchContains) for i in range(widgets.animeList.count()):
it = widgets.animeList.item(i)
it.setHidden(it not in matched_items)
else:
for i in range(widgets.animeList.count()):
it = widgets.animeList.item(i)
it.setHidden(False)
Chưa xử lý string search_anime_field.
Phải sử dụng findItem thay vì findItems.
Sai điều kiện tìm trong phương thức findItems.
Không có vấn đề gì.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
TIN 10_Python
Quiz
•
11th Grade
13 questions
Stoichiometry Basics
Quiz
•
9th Grade - University
15 questions
Kiến thức về văn hóa giao thông
Quiz
•
9th Grade - University
10 questions
TỪ BÀI TOÁN ĐẾN CHƯƠNG TRÌNH
Quiz
•
11th Grade
10 questions
Artificial Intelligence
Quiz
•
11th Grade
10 questions
KIỂM TRA 15P LẦN 2 HK2 ĐỀ 2 KHỐI 12 (24-25)
Quiz
•
10th Grade - University
10 questions
AIRCRAFT SYSTEMS
Quiz
•
9th - 12th Grade
10 questions
Best to best OT 2024
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Science
70 questions
Advanced Biology Semester Review
Quiz
•
9th - 12th Grade
19 questions
ionic vs covalent
Quiz
•
9th - 12th Grade
20 questions
Fall Final Review 2
Quiz
•
11th Grade
19 questions
Thermal Energy and Kinetic Theory
Quiz
•
9th - 12th Grade
18 questions
Unit 6: RNA & Protein Vocab
Quiz
•
9th - 12th Grade
12 questions
Fall Final Review 1
Quiz
•
11th Grade
