निम्नलिखित प्रोग्राम का आउटपुट क्या है:
What will be the output of the following Python code?
str1="helloworld"
str1[::-1] A
dlrowolleh
B
Hello
C
World
D
Helloworld
Explanation
The code str1[::-1] reverses the string str1.
Explanation:
str1 = "helloworld"- The slice notation
[::-1]reverses the string.
So, "helloworld"[::-1] becomes "dlrowolleh".
The correct answer is:
(A) dlrowolleh.
Correct Answer: A) dlrowolleh