English
Tamil Nadu Board of Secondary EducationHSC Science Class 12

Which of the following is the output of the following python code? str1="TamilNadu" print(str1[::-1]) - Computer Science

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

Solution

udanlimaT

Explaantion:

The slicing str1[::-1] reverses the string "TamilNadu" to "udanlimaT".

shaalaa.com
Introduction to Strings
  Is there an error in this question or solution?
Chapter 8: Strings and String manipulation - Evaluation [Page 129]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 12 TN Board
Chapter 8 Strings and String manipulation
Evaluation | Q 1. | Page 129
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×