Python array select one of item and repeat it for selected ranges.
It's maded for some interesting things like evolution no anymore
Example:
<span class "cm-comment"># Create simple array with numbers
array =[0, 10, 20, 13]
<span class "cm-comment"># Call our function
spawn_to_range(array, 13, 4)
<span class "cm-comment">#=> Must be returned a [0, 10, 20, 13, 13, 13, 13]
def spawn_to_range(arr, val, ran):
return
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(spawn_to_range([0, 10, 20, 13], 13, 4), [0, 10, 20, 13, 13, 13, 13])
test.assert_equals(spawn_to_range([0, 10, 12, 14], 10, 3), [0, 10, 10, 10, 12, 14])