Assuming that the snippet below has been executed successfully, which of the following expressions evaluate to True? (Choose two.) string = 'SKY'[::-1] string = string[-1]
Ans A, False # string[0] == 'S' =>So string[0] !== 'Y' return false
Ans B, False # string[0] == 'Y' => but string[-1] = S, return false
Ans C, False # string is None => but string = 'SKY', so return false
Ans D, True # len(string) = 1 => so len(string) == 1, so return true
Correct answer should be B and D
True:
B. string[0] == string [-1]
D. len(string) == 1
upvoted 4 times
...
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
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.
deckman
Highly Voted 3 years, 1 month agoJos015
Most Recent 1 year, 7 months agoemanuelcar990
1 year, 10 months agodicksonpwc
2 years, 2 months agodicksonpwc
2 years, 3 months agomacxsz
3 years, 2 months ago