निम्नलिखित प्रोग्राम का आउटपुट क्या है:
What is the output of the following program:
print("Hello World"[::-1])
A)
B)
C)
D)
Explanation:
Let's break down the code:
print("Hello World"[::-1])
- The string
"Hello World"
is being sliced using[::-1]
. - The
[::-1]
slice notation means "reverse the string."
So, the string "Hello World"
reversed becomes "dlroW olleH"
.
Thus, the correct output is:
(A) dlroW olleH.