PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 13


Which of the following expressions evaluate to True? (Choose two.)

Show Answer
Correct Answer: AD

The expression 'xYz'.lower() > 'XY' evaluates to True because 'xyz' is lexicographically greater than 'XY'. The expression 121 + 1 == int('1' + 2 * '2') evaluates to True because 122 is equal to the integer formed by concatenating '1' and '22', resulting in 122. The other options do not evaluate to True. For example, '8'+'8' == 2 * '8' evaluates to '88' == '88', which is True, not False, and float('3.14') == str('3.' + '14') evaluates to 3.14 == '3.14', which is False, as one is a float and the other is a string.

Discussion

4 comments
Sign in to comment
a4129fdOptions: AD
May 28, 2024

AD are the right ones, as validated in my IDE

Dave304409Options: AD
Jul 2, 2024

A, D is correct

kstrOptions: AD
Jun 5, 2024

AD: print( 'xYz'.lower() > 'XY' ) print('8'+'8' != 2 * '8' ) print( float ('3.14') == str('3.' + '14') ) print( 121 + 1 == int('1' + 2 * '2') )

DKAT2023Options: AD
Jun 28, 2024

A and D are corrects