Python, What is wrong in the following code? range(20,-1,0) return's an error
python
Solution
`range` takes three arguments, start, stop, and step.
range(20,-1,0):
says to go from `20` to `-1` in steps of size `0`.
That doesn't make sense, and so python threw an error.
Problem
``` for i in range(20,-1,0): print(i) ``` and the error is: ``` Traceback (most recent call last): File "D:/Python/b.py", line 1, in <module> for i in range(20,-1,0): ValueError: range() arg 3 must not be zero ```