QuestionQ181

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

What is the output of the following Python code?

Question Image

Explanation

A string slice with a step of -1 returns the characters in reverse order. Therefore, Hello World is printed as dlroW olleH.

Community Discussion

No comments yet. Be the first to start the discussion!