Ad
  • Custom User Avatar

    Why would you replicate Python's range in Python? It's already a built-in there. That makes less sense to me. Yes, I agree it's confusing, but you only can assume if you receive two arguments, they're the first 2, and never the last 2 (just like Python's range).

  • Custom User Avatar

    It looks very similar to the range function from python to me (excluding the step = 0 case).
    So I don't think it is that strange to want such behavior.

    # python 3
    >>> list(range(10))
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> list(range(5, 10))
    [5, 6, 7, 8, 9]
    >>> list(range(5, 10, 2))
    [5, 7, 9]
    >>> list(range(10, 5))
    []
    
  • Custom User Avatar

    It wouldn't work then, but that isn't part of this kata.