1) What is the primary purpose of file handling in Python? a) To create new files b) To manipulate text data c) To organize folders d) To interact with external files and data 2) What is the purpose of the with statement (context manager) when working with files in Python? a) It defines a new function b) It is used for commenting code c) It ensures that the file is properly closed after use d) It allows you to write to a file 3) Which method is used to read a single line from a text file in Python? a) read() b) readlines() c) readline() d) readline(2) 4) What exception might occur when you attempt to open a file that doesn't exist in Python? a) FileNotFoundError b) ValueError c) PermissionError d) TypeError 5) the file object. What is the default value of reference_point? a) 0 b) 1 c) 2 d) 3 6) Which of the following statement is incorrect in the context of binary files? a) Information is stored in the same format as in memory b) No character translation takes place c) Every line ends with a new line character d) pickle module is used for reading and writing 7) of the following option can be used to read all the remaining lines? a) myfile.read() b) myfile.read(n) c) myfile.readline() d) myfile.readlines() 8) Which of the following character acts as default delimiter in a csv file? a) : b) ; c) , d) - 9) Which of the following functions changes the position of file pointer a) flush() b) tell() c) seek() d) offset() 10) The correct syntax of seek() is: a) file_object.seek(offset [, reference_point]) b) seek(offset [, reference_point]) c) seek(offset, file_object) d) seek.file_object(offset)
0%
File Handling in Python
共有
共有
共有
Dilumariya
さんの投稿です
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
クイズ
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?