Test Index

CBSE Class 12 Computer Science 2025 Paper Set 4 Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 6 of 37
Marks: +1, -0
Consider the statements given below and then choose the correct output from the given options :
L=['TIC', 'TAC']
print(L[::-1])
Solution:  
Concept:
The slice L[::-1] returns a new list with the elements of L in reverse order. The elements themselves are not changed.
Explanation:
L has two elements, 'TIC' and 'TAC'. Reversing the order of the elements gives:
['TAC', 'TIC']
Key point: Only the order of the list items is reversed; the strings inside are not reversed, so 'CIT' and 'CAT' never appear.
Answer:
Option D (['TAC', 'TIC'])
© examsnet.com
Advertisements
Go to Question: