Question #99

What is the output of the code snippet below?
"python"[::-2]

The slice notation step goes as per the following: a[start:stop:step]. Here, the slide start at -0 (before "p") and stops at the end (after "n"). As the step is -2, the slice is read backwards, every 2 elements; "n", "h" and "y". (thepythonquiz.com/admin/quiz/question/97/change)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: