Bài test Python cơ bản
Quiz
•
Computers
•
University
•
Hard
Quan Nguyen Manh
Used 8+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Đối với một list my_list, làm thế nào để lấy phần tử cuối cùng của list đó?
my_list[-1]
my_list.last()
my_list.last
my_list[end]
Answer explanation
To get the last element of a list, use my_list[-1]. This index accesses the last element in the list.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Đâu là cách tạo một dictionary rỗng trong Python?
()
{}
[]
{''}
Answer explanation
An empty dictionary in Python can be created using the curly braces {}. This is the correct choice as it creates an empty dictionary, not a tuple, list, or a dictionary with an empty string as a key.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Đâu là kết quả của biểu thức 3 * 3 ** 3
18
81
27
9
Biểu thức không hợp lệ!
Answer explanation
The expression 3 * 3 ** 3 evaluates to 27, which is the correct answer choice.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Trong Python, ta dùng gì để kiểm tra xem một key có tồn tại trong dictionary hay không?
has_key()
check_key()
in
exist_key()
Answer explanation
In Python, we use the 'in' keyword to check if a key exists in a dictionary. It is the correct choice because it allows us to easily determine the presence of a key in a dictionary.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Trong Python, method nào để chuyển đổi một chuỗi thành chữ in hoa?
upper()
uppercase()
to_upper()
capitalize()
Answer explanation
The correct method in Python to convert a string to uppercase is 'upper()'. This method returns a new string with all characters converted to uppercase.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Trong Python, method nào để xóa phần tử cuối cùng của một list?
pop()
remove()
delete()
del
Answer explanation
The correct method to remove the last element of a list in Python is pop(). It removes and returns the last element of the list.
7.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Trong Python, (những) câu lệnh nào sau đây sẽ không gây ra lỗi cú pháp?
a = {1; 2; 3}
a = [1, 2, 3; 4, 5, 6]
a = (1, 2, 3; 4, 5, 6)
a = {1: 'one', 2: 'two', 3: 'three'}
a = (1, 2, 3,)
Answer explanation
The correct choices are a = {1; 2; 3}, a = {1: 'one', 2: 'two', 3: 'three'}, and a = (1, 2, 3,). These choices do not cause syntax errors. The other choices contain syntax errors.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
25 questions
Quiz on Operating System Basics
Quiz
•
University
25 questions
PTS XII - 8
Quiz
•
12th Grade - University
25 questions
PYTHON PROGRAMMING STRING Q6
Quiz
•
University
25 questions
Kuis Internet1 L2324
Quiz
•
University
25 questions
C# Chp. 2 Concepts
Quiz
•
12th Grade - University
25 questions
Basic Components and Computer Evolution
Quiz
•
University
25 questions
Ôn tập GK2 Tin 6
Quiz
•
6th Grade - University
25 questions
S2 Python Turtle Quiz
Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
4 questions
Activity set 10/24
Lesson
•
6th - 8th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
30 questions
October: Math Fluency: Multiply and Divide
Quiz
•
7th Grade
Discover more resources for Computers
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
7 questions
Central Idea of Informational Text
Interactive video
•
4th Grade - University
7 questions
Review for You: Using Commas
Interactive video
•
4th Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
Safari Scholar: Searching for Subject-Verb Agreement
Interactive video
•
4th Grade - University
