Open In App

Python | Miscellaneous | Question 1

Like Article
Like
Save Article
Save
Share
Report issue
Report

What is the output of the following program : 

Python3




print \"Hello World\"[::-1]


(A)

dlroW olleH

(B)

Hello Worl

(C)

d

(D)

Error


Answer: (A)

Explanation:

[::] depicts extended slicing in Python and [::-1] returns the reverse of the string.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads