Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers)
string = 'python' [::2]
string = string[-1] + string[-2]
Suggested Answer: D
Get Premium PCAP-31-03 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
11 comments · newest first
VI
Vicky
1 year ago
How can string be None? That doesn't make sense!
MI
Michal
1 year ago
Wait, string[0] == 'o'? That sounds off.
JA
Jacki
1 year ago
C is definitely wrong, it's not 3.
LA
Lawana
1 year ago
I think A is true!
CA
Cathrine
1 year ago
string is 'no' after the snippet.
LU
Lura
1 year ago
I feel like string[-1] should be 'o' after the reassignment, but I'm not completely confident about the comparison with string[0].
LO
Lon
1 year ago
I remember a practice question where we checked string lengths, but I can't recall if len(string) would be 3 here.
QU
Quinn
1 year ago
I think the string slicing part gives us 'pto', so I'm not sure if string[0] would be 'o' or something else.
MA
Marshall
1 year ago
I definitely remember that 'is None' checks for null values, but I don't think that's relevant here since string has a value now.
RA
Raylene
1 year ago
Option A seems like the most straightforward rule to me. Counting one FTR for each unique data function that is accessed makes the most sense.
AN
Angelica
1 year ago
I've got a good feeling about this. Autonomous agents that can monitor and repair themselves seem like a common use of self-healing tech. I'll go with D.