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
...
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 2 years, 6 months agoJos015
Most Recent 1 year agoemanuelcar990
1 year, 3 months agodicksonpwc
1 year, 7 months agodicksonpwc
1 year, 8 months agomacxsz
2 years, 7 months ago