1) What function is used to open a file in Python? a) open('fruit.txt', 'r+') b) open('fruit.txt', 'a+') c) open('frut.txt', 'a') d) none of the above 2) What is the best approach to guarantee that a file object is correctly closed after use whenever possible? a) Using close() at the end of the code b) Using try and finally blocks c) Using the with keyword d) None of the above 3) What function is used to get a list of all lines in a file? a) read() b) readlines() c) write() d) None of the above 4) Which of the following file types can be opened with notepad as well as ms excel? a) Binary Files b) Text Files c) CSV Files d) none of the above 5) . To open a file c:\scores.txt for writing, we use ____________ a) outfile = open(“c:\scores.txt”, “w”) b) outfile = open(“c:\\scores.txt”, “w”) c) outfile = open(file = “c:\scores.txt”, “w”) d) outfile = open(file = “c:\\scores.txt”, “w”)
0%
python panchayat
共有
共有
共有
Freeuse6669
さんの投稿です
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
クイズ
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?