Return a list of numbers based on the parameters given.
With one param: generate number from 0 to n (inclusive of both)
With two params: generate number from n to m (inclusive of both)
If the range goes from high to low, generate numbers in descending order
If the range goes from low to high, generate numbers in ascending order
Support negative numbers
Instead of 3 and 4, include an optional third parameter, step, that increments the next value in the sequence by that value. Include floating-point values, and if start is greater than end but step is not negative, raise an exception.
Return a list of numbers based on the parameters given.
Instead of 3 and 4, include an optional third parameter, step, that increments the next value in the sequence by that value. Include floating-point values, and if
start
is greater thanend
but step is not negative, raise an exception.