Python基礎課程 - 第4課 Python 自動化程式(二)

Python基礎課程 - 第4課 Python 自動化程式(二)

9th Grade

9 Qs

quiz-placeholder

Similar activities

Python Programming Basics

Python Programming Basics

7th - 11th Grade

12 Qs

9-сынып. Python массив.

9-сынып. Python массив.

1st - 9th Grade

10 Qs

python

python

9th - 10th Grade

12 Qs

Основи Python

Основи Python

7th - 12th Grade

12 Qs

PYTHON (FOR LOOP)

PYTHON (FOR LOOP)

1st - 10th Grade

10 Qs

10.4 Python Lists

10.4 Python Lists

7th - 10th Grade

14 Qs

python quiz

python quiz

6th Grade - Professional Development

10 Qs

Python Math

Python Math

1st - 12th Grade

10 Qs

Python基礎課程 - 第4課 Python 自動化程式(二)

Python基礎課程 - 第4課 Python 自動化程式(二)

Assessment

Quiz

Computers

9th Grade

Hard

Created by

Cheung 張祺豐老師

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

1. 根據 for index in range(0, 4): 指令,在執行最後一次迭代時,index 的值是多少?
A. 0
B. 1
C. 3
D. 4

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

2. 根據 for index in range(1, 9, 4): 指令,在執行第二次迭代時,index 的值是多少?
A. 1
B. 4
C. 5
D. 9

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

3. 下如果變數 n 的初始值為 2.3,以下那個指令能把輸出內容格式化為整數?
A. print("The answer is %d." % n)
B. print("The answer is %s." % n)
C. print("The answer is %f." % n)
D. print("The answer is " + str(n) + ".")

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Media Image
4. 根據下圖程式,如果變數 n 的輸入值為 3,以下哪項是執行結果?
A. The total number is 1.
B. The total number is 2.
C. The total number is 3.
D. The total number is 6.

5.

MATCH QUESTION

1 min • 1 pt

把以下 Python 的 for 循環指令中不同部分的意思配對起來。

for var in range(1, 8, 2):

print(var)

變數的終止值

1

重複執行的指令

var

變數名稱

print(var)

變數的間隔值

8

變數的起始值

2

6.

MATCH QUESTION

1 min • 1 pt

執行以下的 Python 程式,把 for 循環中不同迭代的輸出配對起來。

start = 12

stop = start + 24

step = 4

for n in range(start, stop, step):

print(n)

32

第二次迭代時

12

第一次迭代時

16

最後一次迭代時

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Python 中,for 循環可用於無限次地重複執行指令。

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

這一個 Python 程式以 while 循環寫成。

i = 0

while i < 10:

print(i)

i = i + 1

for i in range(0, 10):

print(i)

for i in range(0, 11):

print(i)

for i in range(1, 10):

print(i)

for i in range(1, 11):

print(i)

9.

FILL IN THE BLANK QUESTION

1 min • 1 pt

執行以下的 Python 程式,電腦屏幕會顯示多少次「Hello」?

for index in range(0, 7, 2):

print("Hello")