Certified Associate in Python Programming (PCAP) — Question 75

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

Answer options

Correct answer: A, C

Explanation

Option A is correct because if the open() function fails, it raises an exception to indicate the error. Option C is also correct as open() indeed returns a file object that allows interaction with a physical file. Options B and D are incorrect; open() does not always require a second argument, and the correct names for the standard streams are sys.stdin, sys.stdout, and sys.stderr.