Certified Associate in Python Programming (PCAP) — Question 78
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. '8' + '8' !=2 * '8'
- B. 'xYz'.lower() > 'XY'
- C. float('3.14') == str('3.' + '14')
- D. 121 + 1 ==int('1' + 2 * '2')
Correct answer: B, D
Explanation
Option B is correct because the lowercased version of 'xYz' is 'xyz', which is greater than 'XY'. Option D is also correct as 121 + 1 equals 122, which is the same as converting '1' + 2 * '2' to an integer. Options A and C are incorrect; A evaluates to False because the string concatenation does not equal the arithmetic operation, and C is False because it compares a float to a string, which are not equal.