题目
Fal25_CS003C_74229 Ch. 7 Pre-Quiz (Remotely Proctored)
单项选择题
When reading a file in Python, you must specify two items:
选项
A.a file name and mode
B.a file name and size
C.a file name and data type
D.a file name and file properties
查看解析
标准答案
Please login to view
思路分析
When evaluating how to read a file in Python, we must recall the essential pieces of information the language needs to establish a file operation.
Option A: 'a file name and mode' is correct because Python's open() function requires at least the path to the file (the file name) and the mode in which to open it (e......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
Consider the following C code sequence: while (fread(&thing, sizeof(data_t), 1, fp) == 1) { // process item that was read ... } If this code sequence and function call appears in a program, it can be reasonably expected:
Which statement below can be used to read data from a file one character at a time?
In the code snippet below, if the file contains the following words: apple, pear, and banana stored one per line, what would be the output? infile = open("input.txt", "r") for word in infile : word = word.rstrip() print(word)
What is returned when the readline method reaches the end of the file?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!