QuestionQ100

VerifiedMiscellaneous (List Comprehensions, Lambdas, Closures, I/O)

Which of these statements are true?

Choose two
Explanation

Read mode ('r') opens an existing file and fails if the file does not exist. Write mode ('w') truncates an existing file when the open operation succeeds, so its prior contents are lost. The default mode is 'r', and an open file is closed with its close() method.

Community Discussion

No comments yet. Be the first to start the discussion!