Intellipaat Back

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

I am trying to loop from 100 to 0. How do I do this in Python?

for i in range (100,0) doesn't work.

1 Answer

0 votes
by (106k points)

You can use the below-mentioned code:

for i in reversed(xrange(101)):

print i,

Related questions

0 votes
1 answer
asked Sep 23, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Oct 11, 2019 in Python by Sammy (47.6k points)
+1 vote
2 answers
asked Aug 28, 2019 in Python by Sammy (47.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...