ITS Python 檔案與例外處理課堂測驗

Quiz
•
Information Technology (IT)
•
6th - 8th Grade
•
Hard
Vans Tsai
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
請問以下對於檔案的開啟模式,何者敘述正確?
r+ 為寫入模式,指標會置於檔頭
w+ 為可讀寫模式,指定檔案沒有時會新增, 再寫入檔案;若檔案已存在,寫入內容會覆蓋原內容
a+ 為可讀寫模式,指定檔案沒有時會新增, 再寫入檔案;若檔案已存在,則會取消寫入
r- 是唯讀模式,能夠保護檔案不會任意被寫入
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
下列程式建立的檔案,會執行哪種動作?
讀取
寫入
可讀取也可寫入
以上皆非
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
請問哪個檔案函式可以關閉一個檔案?
exit()
stop()
Endfile()
close()
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
在讀取檔案中,如果要更換檔案讀取的位置,
請問要使用哪個函式才能有這個功能?
position()
cursor()
seek()
move()
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
你正在製作一個程式,
用來開啟一個單字卡的檔案
單字卡(fruits.txt)的檔案內容如下:
apple
lemon
orange
watermelon
cherry
程式碼如下:
請問 03 行輸出 content 內容為何?
['apple', 'lemon', 'orange', 'watermelon', 'cherry']
['apple\n', 'lemon\n', 'orange\n', 'watermelon\n', 'cherry\n']
apple lemon orange watermelon cherry
apple, lemon, orange, watermelon, cherry
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
請問這段程式碼的最後輸出為何?
True
False
None
程式執行有誤
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
一個純文字檔案(test.txt)的內容為
aaa
bbb
ccc
ddd
eee
現在有一段程式碼能讀取這個檔案,請問 print() 的輸出結果為何?
bbb
Syntax Error
aaa
ddd
Create a free account and access millions of resources
Similar Resources on Wayground
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Multiplying and Dividing Integers

Quiz
•
7th Grade
20 questions
Getting to know YOU icebreaker activity!

Quiz
•
6th - 12th Grade
20 questions
Figurative Language Review

Quiz
•
8th Grade