Search Header Logo

EXAM-1

Authored by Kuei Fang

Science, Education

12th Grade - University

Used 2+ times

EXAM-1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

1 min • 1 pt

list裡面包含50個學生資料,你打算顯示所有學生資料,除了最後4位學生。請問那些程式碼可以達成?

class[1:-4]

class[:-4]

class[1:-5]

class[0:-5]

class[0:-4]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

你開發一個程式,需要匯入sqrt這個函式,並且將這個函式命名一個別名sr,請問下面哪個程式碼可以完成?

from math import sqrt as sr

import sqrt from math as sr

from math.sqrt as sr

import math.sqrt as sr

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

請問要隨機產生15~21(包含15與21)之間的整數,以下哪兩個程式碼可以達成?

random.randint(15, 21)

random.randint(15, 22)

random.randrange(15, 21, 1)

random.randrange(15, 22, 1)

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

你需要讀入與寫入資料到某個檔案,若檔案不存在,則會自動產生,若檔案已經存在,而且檔案裡在已經有內容,則這些內容會被刪除。請問你應該使用以下哪個程式碼?

open("f1.txt", "r")

open("f1.txt", "w")

open("f1.txt", "r+")

open("f1.txt", "w+")

open("f1.txt", "a+")

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

請問以下程式碼的結果?

list1 = range(6,0,-3)

print(list(list1))

error

[6, 3]

[6, 3, 0]

[6, 3, 0, -3]

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

請問以下程式碼的結果=?

0 or -1

True

False

Compile error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

a=[1,2,3,4,5]

b=a

print(a is b)

True

False

Error

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?