QuestionQ38

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

Which of the following statements is true?

Choose two
  • A if invoking open() fails, the value None is returned
  • B open() is a function which returns an int that represents a physical file handle
  • C the second open() argument is optional
  • D stdin, stdout, stderr are the names of pre-opened streams
Explanation

Python’s open() function has an optional second mode parameter that defaults to reading text ("r"). The standard streams stdin, stdout, and stderr are pre-opened input, output, and error streams.

Community Discussion

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