Advertisements
Advertisements
Question
Which of the following is the output of the following python code?
str1="TamilNadu"
print(str1[::-1])Options
Tamilnadu
Tmlau
udanlimaT
udaNlimaT
MCQ
Advertisements
Solution
udanlimaT
Explaantion:
The slicing str1[::-1] reverses the string "TamilNadu" to "udanlimaT".
shaalaa.com
Concepts of Strings in Python
Is there an error in this question or solution?
