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 50 discussion

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

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

  • A. 'dcb' not in 'abcde'[::-1]
  • B. 'True' not in 'False'
  • C. str(1-1) in '0123456789'[:2]
  • D. 'phd' in 'alpha'
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Abbribas
1 month, 2 weeks ago
Selected Answer: BC
A. 'dcb' not in 'abcde'[::-1] Evaluation: The reversed string is 'edcba'. The substring 'dcb' is found in 'edcba'. Result: False B. 'True' not in 'False' Evaluation: The substring 'True' is not found in the string 'False'. Result: True C. str(1-1) in '0123456789'[:2] Evaluation: str(1-1) is '0'. The slice '0123456789'[:2] is '01'. The substring '0' is in '01'. Result: True D. 'phd' in 'alpha' Evaluation: The substring 'phd' is not found in the string 'alpha'. Result: False
upvoted 1 times
...
KuaciCorn
10 months, 3 weeks ago
Selected Answer: BC
B&C is the correct answer
upvoted 1 times
...
jarun2024
11 months, 3 weeks ago
B&C is the correct answer
upvoted 1 times
...
JeyTlenJey
1 year ago
Selected Answer: BC
print("A.", 'dcb' not in 'abcde'[::-1], "list:",'abcde'[::-1]) #False; 'edcba' print("B.", 'True' not in 'False') #True, strings print("C.", str(1-1) in '0123456789'[:2],"str:",str(1-1),"in:",'0123456789'[:2]) #True '01' print("D.", 'phd' in 'alpha') #False
upvoted 2 times
...
Dave304409
1 year ago
Selected Answer: BC
is correct
upvoted 1 times
...
kstr
1 year, 1 month ago
BC CORRECT
upvoted 1 times
...
DKAT2023
1 year, 1 month ago
Selected Answer: BC
B and C are corrects
upvoted 1 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 ...