Python căn bản

Python căn bản

University

12 Qs

quiz-placeholder

Similar activities

Rhetorical Fallacies

Rhetorical Fallacies

University

15 Qs

IPA - Session 6 - Review /b/ /p/ ;  /s/ /z/ /ʃ/

IPA - Session 6 - Review /b/ /p/ ; /s/ /z/ /ʃ/

KG - Professional Development

15 Qs

Building Vocabulary

Building Vocabulary

University

10 Qs

IBM_Data Privacy

IBM_Data Privacy

University

13 Qs

IT 5- Unit 4- Vocabulary

IT 5- Unit 4- Vocabulary

University

10 Qs

"The Free-Rider Continent"

"The Free-Rider Continent"

University

10 Qs

Research Methodology Quiz

Research Methodology Quiz

University

10 Qs

Python căn bản

Python căn bản

Assessment

Quiz

English

University

Practice Problem

Hard

Created by

Ngọc Tùng Dương Lương

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

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?