Which of the following slicing examples will display content of string TXT in…

2026

Which of the following slicing examples will display content of string TXT in reversed order in Python?

Answer: A. print(TXT[::-1])

  1. A.

    print(TXT[::-1])

  2. B.

    print(TXT[-1])

  3. C.

    print(TXT[1-1])

  4. D.

    print(TXT[0:-1])

Attempted by 351 students.

Show answer & explanation

Correct answer: A

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…