Certified Associate in Python Programming (PCAP-31-03) — Question 8
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. ord("0") - ord("9") == 10
- B. len("''") == 2
- C. chr(ord('z') - 1) == 'y'
- D. len(''1234'') == 4
Correct answer: C, D
Explanation
Option C is correct because the character before 'z' is indeed 'y'. Option D is also correct as the length of the string ''1234'' is 4. Options A and B are incorrect; A evaluates to -9, and B evaluates to 3.