Skip to content

Instantly share code, notes, and snippets.

@Ashaba
Created July 5, 2019 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ashaba/034ccf9136fcb945d644c6b4210b40e1 to your computer and use it in GitHub Desktop.
Save Ashaba/034ccf9136fcb945d644c6b4210b40e1 to your computer and use it in GitHub Desktop.
A function that merges two arrays together at a given length creating one array array
def merge_arrays(a, b, c):
index = 0
b_index = 0
b_len = len(b)
d = []
for i in a:
d.append(i)
index += 1
if index == c:
if b_index < b_len:
d.append(b[b_index])
b_index += 1
index = 0
while b_index < b_len:
d.append(b[b_index])
b_index += 1
return d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment