Exam PCAP All QuestionsBrowse all questions from this exam
Question 112

Which of the following statements are true? (Choose two.)

    Correct Answer: A, C

    If invoking open() fails, an exception is raised which makes statement A true. open() is a function that creates a file object, so statement C is also correct. Statement B is incorrect because open() can take just one argument, the file path, with the mode being optional. Statement D is incorrect because the correct names of the pre-opened streams are stdin, stdout, and stderr, not instd, outstd, and errstd.

Discussion
macxszOptions: AC

answer is correct: AC

Ujjal_dOptions: AC

So it is A C right?

cufta05Options: AD

A. If invoking open() fails, an exception is raised. D. instd, outstd, errstd are the names of pre-opened streams.

aserrOptions: AD

C is wrong. According to python doc "mode" is an optional string. instd, outstd. errstd are preopened streams in sys module. Would go then for A and D.

deckman

it's not instd, outstd, errstd... "stdin", "stdout" and "stderr" would be the correct ones

stuartz

it is stdin, stdout, and stderr