Ad
Code
Diff
  • def spawn_to_range(arr, val, ran):
        i = arr.index(val)
        return arr[:i]+[val]*ran+arr[i+1:]
    • def spawn_to_range(arr, val, ran):
    • index = arr.index(val)
    • return arr[:index]+[val for x in range(ran)]+arr[index+1:]
    • i = arr.index(val)
    • return arr[:i]+[val]*ran+arr[i+1:]
Code
Diff
  • def spawn_to_range(arr, val, ran):
        index = arr.index(val)
        return arr[:index]+[val for x in range(ran)]+arr[index+1:]  
    • def spawn_to_range(arr, val, ran):
    • return
    • index = arr.index(val)
    • return arr[:index]+[val for x in range(ran)]+arr[index+1:]