Certified Associate in Python Programming (PCAP) — Question 111
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. ord(ג€zג€) - ord(ג€Zג€) == ord(ג€0ג€)
- B. len(ג€ג€ג€ ג€ג€ג€) > 0
- C. chr(ord('a') + 1) == 'B'
- D. len('\'') == 1
Correct answer: B, D
Explanation
Option B is correct because the length of the string containing two 'ג€' characters is greater than zero. Option D is also correct as the length of the string containing a single backslash is indeed 1. Options A and C do not evaluate to True; A involves a mathematical comparison that does not hold, and C incorrectly compares the character after 'a' to 'B'.