Advertisements
Advertisements
Question
Consider the statements given below and then choose the correct output from the given options:
L=[‘TIC’, ‘TAC’]
print(L[::-1])Options
[‘CIT’, ‘CAT’][‘TIC’, ‘TAC’][‘CAT’, ‘CIT’]
[‘TAC’, ‘TIC’]
MCQ
Advertisements
Solution
[‘TAC’, ‘TIC’]
Explanation:
The slice L[::-1] reverses the order of elements in the list, so the list is printed in reverse.
shaalaa.com
Is there an error in this question or solution?
