I want to loop from 100 to 0, how do I do it?
for i in range (100,0) #this is not working
You can make use of negative indices to start from back:
for i in range(100):
k = 100 - i
Or You can use:
for i in reversed(range(101)):
Both will give same output that is 100 to 0
Operator ^ is a bitwise operator, which does "bitwise exclusive or".
The ...READ MORE
Hi, it is pretty simple, to be ...READ MORE
$ to match the end of the ...READ MORE
down voteacceptedFor windows:
you could use winsound.SND_ASYNC to play them ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Reversing a list is a commonly used ...READ MORE
You can use sleep() method to sleep ...READ MORE
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.