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 64 discussion

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

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

  • A. if open()'s second argument is 'r', the file must exist or open will fail
  • B. the second open() argument describes the open mode and defaults to 'w'
  • C. if open()'s second argument is 'w' and the invocation succeeds, the previous file's content is lost
  • D. closing an opened file is performed by the closefile() function
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

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: AC
A. True (opening for reading requires the file to exist). B. False (the default open mode is 'r', not 'w'). C. True (opening in 'w' mode truncates the file, deleting existing content). D. False (files are closed using the close() method, not a closefile() function).
upvoted 1 times
...
Dave304409
1 year ago
Selected Answer: AC
is correct
upvoted 3 times
...
JeyTlenJey
1 year ago
Selected Answer: AC
Correct: A, C
upvoted 1 times
...
kstr
1 year, 1 month ago
AC tested
upvoted 1 times
...
DKAT2023
1 year, 1 month ago
Selected Answer: AC
A and C are 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 ...