NEW
Font size
WorksheetsPython if–else Practice 2026
Total questions: 15
Worksheet time: 8mins
Python 中用来做判断的关键字是?
(Which keyword is used for decision making in Python?)
for
if
while
else
以下哪个是正确的 if 语法?
(Which one is the correct if syntax?)
if score > 60
if score > 60:
if (score > 60)
if score > 60 then
判断题:Python 的 if 后面一定要有冒号 ( : )。
(True or False: A colon (:) is required after an if statement in Python.)
True
False
以下哪个符号是“等于”判断?
(Which symbol is used to check equality in Python?)
=
==
!=
>=
判断题:else 一定要配合 if 使用。
(True or False: else must always be used with if.)
True
False
以下程序的输出是什么?
(What is the output of the following code?)
Pass
Fail
Error
Nothing
以下程序的输出是什么?
(What is the output of the following code?)
Can vote
Cannot vote
Error
Nothing
哪个条件表示“score 不等于 100”?
(Which condition means “score is not equal to 100”?)
score = 100
score == 100
score != 100
score >= 100
判断题:以下代码是正确的。
(True or False: The following code is correct.)
if score > 60:
print('Pass')
True
False
以下哪一行会造成错误?
(Which line will cause an error?)
if number > 0:
else:
print('Hello')
if score == 50
以下代码缺少哪个关键字?
(What keyword is missing in the code below?)
if
else
for
while
以下程序的输出是什么?
(What is the output of the following code?)
Not zero
Zero
Error
Nothing
判断题:if–else 可以用来判断成绩、年龄和密码。
(True or False: if–else can be used to check scores, ages, and passwords.)
True
False
以下哪个情境最适合使用 if–else?
(Which situation is best suited for using if–else?)
Print a certain sentence 10 times
Determine if it is raining
Store 100 data items
write a function
以下哪一个是条件?
(Which of the following is a condition?)
print('Hi')
score >= 60
input('Name')
int(score)
