Câu 7: PCED-30-02: PCED - Certified Entry-Level Data Analyst with Python
You want to safely read the contents of a file named records.txt and store them in a list. Your requirements are:The file should be automatically closed after reading,The code should check whether the file exists before opening it, andIt should handle missing file errors gracefully. Which of the following is the most…
Nội dung câu hỏi
You want to safely read the contents of a file named records.txt and store them in a list. Your requirements are:The file should be automatically closed after reading,The code should check whether the file exists before opening it, andIt should handle missing file errors gracefully. Which of the following is the most appropriate way to accomplish this task in Python? Select the best answer.
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
-
A. Lựa chọn A bằng hình ảnh
-
B. Lựa chọn B bằng hình ảnh
-
C. Lựa chọn C bằng hình ảnh
-
D. Lựa chọn D bằng hình ảnh — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.