Skip to content
Related Articles
Open in App
Not now

Related Articles

Python | Miscellaneous | Question 1

Improve Article
Save Article
Like Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article
Like Article

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

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!