fizz_array_3

Given start and end numbers, return a new list containing the sequence of integers from start up to but not including end, so start=5 and end=10 yields {5, 6, 7, 8, 9}. The end number will be greater or equal to the start number. Note that a length-0 list is valid. (See also: FizzBuzz Code)

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

5
10

Output:

[5, 6, 7, 8, 9]

Test 2

Input:

11
18

Output:

[11, 12, 13, 14, 15, 16, 17]

Test 3

Input:

1
3

Output:

[1, 2]

Test 4

Input:

1
2

Output:

[1]

Test 5

Input:

1
1

Output:

[]

Test 6

Input:

1000
1005

Output:

[1000, 1001, 1002, 1003, 1004]