
Python căn bản
Quiz
•
English
•
University
•
Practice Problem
•
Hard
Ngọc Tùng Dương Lương
FREE Resource
Enhance your content in a minute
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Trong Python, cú pháp đúng để gán giá trị 5 cho biến x là:
x : 5
x == 5
x = 5
5 = x
Answer explanation
Trong Python, gán giá trị dùng dấu = với cú pháp tên_biến = giá_trị.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Kiểu dữ liệu nào dưới đây là kiểu số thực trong Python?
"3.5"
3
True
3.5
Answer explanation
3.5 là số thực (float). "3.5" là chuỗi, 3 là số nguyên, True là kiểu logic.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu lệnh print(2**3) trong Python sẽ in ra kết quả nào?
6
8
9
5
Answer explanation
2**3 = 2 ^ 3 = 8
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Hàm len() trong Python dùng để làm gì?
Tính tổng
Đếm số phần tử
Kiểm tra kiểu dữ liệu
Sắp xếp danh sách
Answer explanation
len() trả về số lượng phần tử trong List, String, Dict, v.v
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Python, vòng lặp for dùng để:
Tạo điều kiện dừng vòng lặp
Lặp lại khi điều kiện đúng
Duyệt qua các phần tử trong một tập hợp
Tạm dừng chương trình
Answer explanation
vòng for được dùng để duyệt qua các phần tử trong chuỗi, list, range, v.v.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cú pháp đúng để định nghĩa hàm trong Python là:
def myFunc():
function myFunc():
define myFunc():
func myFunc():
Answer explanation
Trong Python, khai báo hàm dùng từ khóa def.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Để lấy từ phần tử thứ 2 đến thứ 5 của list A, cú pháp đúng là:
A[2:5]
A[1:5]
A[2,5]
A[1,4]
Answer explanation
Trong Python, chỉ số bắt đầu từ 0 nên phần tử thứ 2 là index 1; slice lấy đến trước chỉ số cuối.
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
VOCABULARY: MANAGING DIFFICULTIES
Quiz
•
University
15 questions
E4F U 5 Functions, Mr. Ahmed Sleem
Quiz
•
University
11 questions
ToEFL reading Scientific Research
Quiz
•
12th Grade - University
16 questions
Academic Vocabulary in Use (units 3,12,25)
Quiz
•
University
10 questions
CELEBRITY IN HOLLYWOOOD
Quiz
•
12th Grade - University
10 questions
Ethical Standards in Writing
Quiz
•
11th Grade - University
10 questions
Vocabulary in Education Context
Quiz
•
12th Grade - University
11 questions
EAP 2 Lesson 3.2 What Should Be Referenced?
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
