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

PYQ KVS TGT/PGT 2026

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

  1. A.

    print(TXT[::-1])

  2. B.

    print(TXT[:-1])

  3. C.

    print(TXT[-1])

  4. D.

    print(TXT[:0:-1])

Attempted by 765 students.

Sign up free to check your answer

Sign up free

Explore the full course: Kvs Nvs Tier 2 Computer Science

Loading lesson…