Certified Associate in Python Programming (PCAP-31-03) — Question 5
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. 'xYz'.lower() > 'XY'
- B. '8'+'8' ! = 2 * '8'
- C. float ('3.14') == str('3.' + '14')
- D. 121 + 1 == int('1' + 2 * '2')
Correct answer: A, D
Explanation
Option A is correct because the lowercase version of 'xYz' is 'xyz', which is indeed greater than 'XY'. Option D is also correct as the expression evaluates to 122, which matches the result of int('1' + '22'). The other options do not evaluate to True: B compares a string concatenation with an integer multiplication incorrectly, and C compares a float with a string, which will not result in equality.