PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 91


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

Show Answer
Correct Answer: AD

121 + 1 is evaluated as an integer sum resulting in 122, while '1' + 2 * '2' is evaluated as string concatenation resulting in '122', hence they are not equal and the expression evaluates to True. '3.14' as a string is not equal to the string representation of the float 3.1415, hence this expression also evaluates to True. Therefore, the correct answers are A and D.

Discussion

6 comments
Sign in to comment
stuartzOptions: AD
Jun 15, 2022

>>> 121 + 1 != '1' + 2 * '2' True >>> '3.14' != str(3.1415) True >>> 'AbC'.lower() < 'AB' False >>> '1' + '1' + '1' < '1' *3' File "<stdin>", line 1 '1' + '1' + '1' < '1' *3' ^ SyntaxError: EOL while scanning string literal

Noarmy315Options: AD
Jan 1, 2022

it seems AD

TheNetworkStudentOptions: AD
Mar 6, 2022

I think I've deciphered it to the following: print(121 + 1 != '2' * 2 + '1') print(3 * '1' > '1' + '1' + '1') print('AbC'.lower() < 'AB+') print(3.14 != str(3.1415)) if that's true, it's A & D

TheNetworkStudent
Mar 6, 2022

minus the + in the third line after AB...

macxszOptions: AD
Apr 28, 2022

A and D are True

DTL001
Dec 19, 2021

It's illisible

9prayerOptions: AD
Feb 5, 2023

A and D are True