Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 12 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 12
Topic #: 1
[All PCAP-31-03 Questions]

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

  • A. ord("0") - ord("9") == 10
  • B. len("''") == 2
  • C. chr(ord('z') - 1) == 'y'
  • D. len(''1234'') == 4
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
dune0
1 week, 3 days ago
Selected Answer: BC
A is False, since ord("0") = 48 and ord("9") = 57, so 48-57 = -9, therefore != 10 B & C are correct: B has a string containing 2 single quotation marks, therefore a length of 2 C is correct since: ord("z") = 122, 122 -1 = 121, chr(121) = "y" D seems correct, but if we pay close attention, the code is erroneous. There are no double quotation marks, there are 2 single quotation marks on each side, making the code snipped erroneous.
upvoted 1 times
...
jarun2024
2 months, 3 weeks ago
Correct Ans: B & C >>> print(len("''") == 2) True >>> print( chr(ord('z') - 1) == 'y') True
upvoted 1 times
...
jarun2024
2 months, 3 weeks ago
Ans : C & D
upvoted 1 times
...
eskimolight
4 months ago
B, C D = All the 3 are correct.
upvoted 1 times
...
Dave304409
4 months, 3 weeks ago
C, D is correct
upvoted 1 times
...
DKAT2023
4 months, 3 weeks ago
C and D are corrects
upvoted 1 times
...
kstr
5 months, 2 weeks ago
BCD are TRUE TESTED: print(ord("0") - ord("9") == 10) print(len("''")== 2) print(chr(ord('z') - 1) == 'y') print(len("1234") == 4)
upvoted 3 times
...
a4129fd
5 months, 3 weeks ago
Selected Answer: CD
As tested in my IDE
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...