Certified Associate in Python Programming (PCAP-31-03) — Question 102
Which of the following expressions evaluate to True? (Choose two.)
Answer options
- A. 'abc'.upper() < 'abc'
- B. '1'+'2' * 2 != '12'
- C. 3 * 'a' < 'a' * 2
- D. 11 == '011'
Correct answer: A, B
Explanation
Option A is correct because the uppercase version of 'abc' ('ABC') is always greater than 'abc'. Option B is correct because the expression evaluates to '122' which is not equal to '12'. Options C and D are incorrect as they do not evaluate to True based on Python's rules for string multiplication and comparison.