Related Articles

Related Articles

Python | Miscellaneous | Question 1
  • Last Updated : 29 Jan, 2016

What is the output of the following program :

filter_none

edit
close

play_arrow

link
brightness_4
code

print "Hello World"[::-1]

chevron_right


(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

My Personal Notes arrow_drop_up
Recommended Articles
Page :