Share python quiz

trangrizzly

New member
** Câu đố Python: Kiểm tra kiến thức của bạn về ngôn ngữ lập trình **

#phiếu

**Hướng dẫn:**

Bài kiểm tra này được thiết kế để kiểm tra kiến thức của bạn về ngôn ngữ lập trình Python.Nó chứa 10 câu hỏi trắc nghiệm, mỗi câu hỏi có bốn câu trả lời có thể.Để vượt qua bài kiểm tra, bạn phải trả lời chính xác ít nhất 8 câu hỏi.

**Câu hỏi 1:**

Đầu ra của mã python sau đây là gì?

`` `Python
In ("Xin chào, Thế giới!")
`` `

(A) `Xin chào, thế giới!`
(B) `12345`
(C) `Không`
(D) `Error`

**Câu hỏi 2:**

Loại biến sau đây là gì?

`` `Python
x = 10
`` `

(A) `int`
(B) `float`
(C) `str`
(D) `Không`

** Câu 3: **

Đầu ra của mã python sau đây là gì?

`` `Python
x = 10
y = 20
in (x + y)
`` `

(A) `10`
(B) `20`
(C) `30`
(D) `Error`

** Câu 4: **

Đầu ra của mã python sau đây là gì?

`` `Python
x = "Xin chào, thế giới!"
in (x [0])
`` `

(A) `H`
(B) `E`
(C) `l`
(D) `O`

** Câu 5: **

Đầu ra của mã python sau đây là gì?

`` `Python
x = [1, 2, 3, 4, 5]
in (x [-1])
`` `

(A) `1`
(B) `2`
(C) `3`
(D) `4`

** Câu 6: **

Đầu ra của mã python sau đây là gì?

`` `Python
x = {"name": "john", "tuổi": 20}
in (x ["tên"]))
`` `

(A) `John`
(B) `20`
(C) `Không`
(D) `Error`

** Câu 7: **

Đầu ra của mã python sau đây là gì?

`` `Python
def add (x, y):
trả lại x + y

In (Thêm (10, 20))
`` `

(A) `10`
(B) `20`
(C) `30`
(D) `Error`

** Câu 8: **

Đầu ra của mã python sau đây là gì?

`` `Python
Đối với x trong phạm vi (10):
in (x)
`` `

(A) `0, 1, 2, 3, 4, 5, 6, 7, 8, 9`
(B) `10`
(C) `Không`
(D) `Error`

** Câu 9: **

Đầu ra của mã python sau đây là gì?

`` `Python
Trong khi đúng:
In ("Xin chào, Thế giới!")
`` `

(A) `Xin chào, thế giới!`
(B) `10`
(C) `Không`
(D) `Error`

** Câu 10: **

Đầu ra của mã python sau đây là gì?

`` `Python
thử:
In ("Xin chào, Thế giới!")
ngoại trừ ngoại lệ như E:
in (e)
`` `

(A) `Xin chào, thế giới!`
(B) `10`
(C) `Không`
(D) `Ngoại lệ: Xin chào, Thế giới!`

##### ** Câu trả lời: **

1. (a)
2. (a)
3. (c)
4. (a)
5. (d)
6. (a)
7. (c
=======================================
**Python Quiz: Test Your Knowledge of the Programming Language**

###### #Python #Programming #Quiz #learnpython

**Instructions:**

This quiz is designed to test your knowledge of the Python programming language. It contains 10 multiple-choice questions, each with four possible answers. To pass the quiz, you must answer at least 8 questions correctly.

**Question 1:**

What is the output of the following Python code?

```python
print("Hello, world!")
```

(A) `Hello, world!`
(B) `12345`
(C) `None`
(D) `Error`

**Question 2:**

What is the type of the following variable?

```python
x = 10
```

(A) `int`
(B) `float`
(C) `str`
(D) `None`

**Question 3:**

What is the output of the following Python code?

```python
x = 10
y = 20
print(x + y)
```

(A) `10`
(B) `20`
(C) `30`
(D) `Error`

**Question 4:**

What is the output of the following Python code?

```python
x = "Hello, world!"
print(x[0])
```

(A) `H`
(B) `e`
(C) `l`
(D) `o`

**Question 5:**

What is the output of the following Python code?

```python
x = [1, 2, 3, 4, 5]
print(x[-1])
```

(A) `1`
(B) `2`
(C) `3`
(D) `4`

**Question 6:**

What is the output of the following Python code?

```python
x = {"name": "John", "age": 20}
print(x["name"])
```

(A) `John`
(B) `20`
(C) `None`
(D) `Error`

**Question 7:**

What is the output of the following Python code?

```python
def add(x, y):
return x + y

print(add(10, 20))
```

(A) `10`
(B) `20`
(C) `30`
(D) `Error`

**Question 8:**

What is the output of the following Python code?

```python
for x in range(10):
print(x)
```

(A) `0, 1, 2, 3, 4, 5, 6, 7, 8, 9`
(B) `10`
(C) `None`
(D) `Error`

**Question 9:**

What is the output of the following Python code?

```python
while True:
print("Hello, world!")
```

(A) `Hello, world!`
(B) `10`
(C) `None`
(D) `Error`

**Question 10:**

What is the output of the following Python code?

```python
try:
print("Hello, world!")
except Exception as e:
print(e)
```

(A) `Hello, world!`
(B) `10`
(C) `None`
(D) `Exception: Hello, world!`

###### **Answers:**

1. (A)
2. (A)
3. (C)
4. (A)
5. (D)
6. (A)
7. (C
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top