ExamVeda
Login
Home
Python Built In Functions
?

Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?

Answer & Solution
Correct Answer: Option D
To print a list in reverse order in Python, you can use the reversed() function, which returns an iterator that yields items in reverse order. However, to display it as a list, you need to convert the iterator back to a list using the list() function. Therefore, list(reversed(l)) is the correct method to print the list l in reverse order.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.