Search Header Logo

Câu hỏi trắc nghiệm Python

Authored by Quyên Trần

Computers

10th Grade

Used 2+ times

Câu hỏi trắc nghiệm Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Trong ngôn ngữ Python, lệnh nào dùng để hiển thị dữ liệu ra màn hình?

output()

display()

print()

write()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Kết quả của đoạn lệnh sau là gì? print("Hello", "world!")

Hello world!

Hello

world!

Hello, world!

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Cho đoạn mã sau: name = input("Your name: ") print("Hello", name) Lệnh input(...) thực hiện chức năng gì?

Hiển thị chuỗi "Hello" ra màn hình.

Gán giá trị mặc định cho biến name.

Nhập dữ liệu từ người dùng và gán vào biến name.

In tên người dùng ra màn hình.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Trong Python, khi nào cần dùng hàm int() kết hợp với input()?

Khi muốn in kết quả ra màn hình.

Khi cần nhập chuỗi ký tự.

Khi cần nhập và xử lý dữ liệu dạng số nguyên.

Khi muốn hiển thị số nguyên.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Đâu là lý do chính khiến đoạn mã sau bị lỗi? x = input("Nhập số: ") print(x + 10)

input không hoạt động trong Python.

Không thể cộng chuỗi với số nguyên.

Thiếu dấu ngoặc kép.

print không in được số.

6.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Đoạn mã nào dưới đây giúp nhập 2 số thực và tính trung bình cộng của chúng?

a = input("a = ") b = input("b = ") print((a + b)/2)

a = float(input("a = ")) b = float(input("b = ")) print((a + b)/2)

a = int(input("a = ")) b = int(input("b = ")) print(a + b / 2)

a = input() b = input() print(a + b)

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Cho đoạn mã: name = input("Tên của bạn là gì? ") print("Chào", name) Nếu người dùng nhập 'Lan', kết quả là gì?

Tên của bạn là gì? Lan

Chào Lan

Hello Lan

Lan

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?