Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

How can you produce the following list with range() in Python?

[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]

1 Answer

0 votes
by (106k points)

To print a list in reverse order with range() you can use the list (reversed()) function below is the piece of code that uses the reversed() function.

print(list(reversed(range(10))))

image

Browse Categories

...