Python_Institute
PCAP-31-03 · Question #16
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? string = 'python' [::2] string = string[-1] + string[-2]
The correct answer is D. string[0] == 'o'. See the full explanation below for the reasoning.
Question
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? string = 'python' [::2] string = string[-1] + string[-2]
Options
- Astring[0] == string[-1]
- Bstring is None
- Clen (string] == 3
- Dstring[0] == 'o'
How the community answered
(59 responses)- A5% (3)
- B17% (10)
- C5% (3)
- D73% (43)
Community Discussion
No community discussion yet for this question.