Search Header Logo

Python程式碼結構測試

Authored by 王煒豪 王煒豪

Computers

10th Grade

Python程式碼結構測試
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Python的基本資料型別有哪些?

整數、浮點數、布林值、字串、列表、元組、集合、字典

布林值集合

浮點數字典

整數陣列

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

如何定義一個函數?

一個函數是將輸入映射到輸出的一段可重用代碼。

一個函數是數學中的一個常數。

函數是用來存儲數據的容器。

函數只能接受一個輸入參數。

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

什麼是條件語句,舉例說明?

例如:if (x > 10) { console.log('x 大於 10'); } else { console.log('x 小於或等於 10'); }

例如:if (x != 20) { console.log('x 不等於 20'); }

例如:if (x < 5) { console.log('x 小於 5'); }

例如:if (x == 10) { console.log('x 等於 10'); }

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Python中如何使用迴圈?

使用列表推導式來執行迴圈操作。

使用函數來替代迴圈操作。

使用for迴圈或while迴圈來執行迴圈操作。

使用if語句來執行迴圈操作。

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

什麼是模組,如何導入模組?

模組是一次性使用的代碼片段,無法重用。

模組是用來存儲數據的容器,與代碼無關。

模組是可重用的代碼單元,導入模組使用 'import' 語句。

導入模組需要使用 'load' 語句。

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?