0 votes
1 view
in Python by (47.8k 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 (107k 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

Related questions

0 votes
1 answer
asked Jul 2, 2019 in Python by Anurag (33.2k points)
0 votes
1 answer
asked Jul 11 in Python by ashely (44.2k points)
0 votes
1 answer
asked Oct 14, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
asked Jul 3, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...