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

Quiz
•
Computers
•
10th Grade
•
Hard
Quyên Trần
Used 2+ times
FREE Resource
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
8.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
Để đảm bảo thực hiện phép cộng 2 số nguyên nhập từ bàn phím, ta cần viết:
a = input("a = ") b = input("b = ") print(a + b)
a = int(input("a = ")) b = int(input("b = ")) print(a + b)
a = float(input("a = ")) b = float(input("b = ")) print(a * b)
a = input() b = input() print(a * b)
Similar Resources on Wayground
10 questions
Perangkat Komputer

Quiz
•
1st - 12th Grade
10 questions
Python - kl. 8

Quiz
•
7th - 12th Grade
10 questions
Bài 6 - tin học 10

Quiz
•
10th Grade
13 questions
Python Iteration

Quiz
•
10th Grade
10 questions
phép gán, các lệnh vào ra đơn giản python

Quiz
•
10th Grade
10 questions
Bài 1 - Chương trình bảng tính - Tin 7

Quiz
•
7th Grade - University
14 questions
year 8 lesson 2 quiz - python

Quiz
•
8th - 10th Grade
15 questions
Ôn tập HK2 Python 10

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade