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])
- A.
print(TXT[::-1])
- B.
print(TXT[-1])
- C.
print(TXT[1-1])
- D.
print(TXT[0:-1])
Attempted by 351 students.
Show answer & explanation
Correct answer: A
Loading lesson…