PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 64


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

Show Answer
Correct Answer: AC

If open()'s second argument is 'r', the file must exist or the open function will fail because 'r' stands for reading, and you cannot read a non-existent file. Additionally, if open()'s second argument is 'w' and the invocation succeeds, the previous file's content is indeed lost because 'w' stands for writing, and it truncates the file's content to zero length, effectively erasing it.

Discussion

2 comments
Sign in to comment
DKAT2023Options: AC
Jul 12, 2024

A and C are correct

kstrOptions: AC
Jul 12, 2024

AC tested