Certified Associate in Python Programming (PCAP-31-03) — Question 50
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. len(""" """) > 0
- B. len('\'') == 1
- C. ord("z") - ord("Z") == ord("0")
- D. chr(ord('a') + 1) == 'B'
Correct answer: A, B
Explanation
Option A evaluates to False because the length of an empty string is 0. Option B is correct as it checks the length of a single backslash, which is indeed 1. Options C and D are incorrect as they do not hold true based on the ASCII values and character conversions involved.