exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 109 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 109
Topic #: 1
[All PCAP-31-03 Questions]

Which of the following statements are 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. instd, outstd, errstd are the names of pre-opened streams
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Abbribas
1 month, 2 weeks ago
Selected Answer: CD
A. if invoking open() fails, the value None is returned ❌ False — If open() fails (e.g., file not found), it raises an exception (like FileNotFoundError), not return None. B. open() is a function which returns an int that represents a physical file handle ❌ False — open() returns a file object, not an integer. C. the second open() argument is optional ✅ True — The second argument (mode) defaults to 'r' (read mode) if omitted. D. instd, outstd, errstd are the names of pre-opened streams ❌ False — The correct names are stdin, stdout, stderr, from the sys module. ✅ True — If D was intended to say sys.stdin, sys.stdout, sys.stderr, then it is correct.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...