PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 112


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

Show Answer
Correct Answer: AC

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

4 comments
Sign in to comment
macxszOptions: AC
May 4, 2022

answer is correct: AC

aserrOptions: AD
Apr 11, 2022

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
May 14, 2022

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

stuartz
Jun 20, 2022

it is stdin, stdout, and stderr

cufta05Options: AD
Jun 21, 2023

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

Ujjal_dOptions: AC
Aug 22, 2023

So it is A C right?