Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Merging Two Arrays to a Third Array
- List1 = [1115, 1345, 1567, 1696, 1783, 1980, 9998]
- List2 = [1105, 1379, 1394, 1412, 1696, 1701, 9999]
- List3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- # continue your program below
- p = 0
- q = 0
- i = 0
- run = True
- while run == True:
- if List2[p] > List1[q]:
- List3[i] = List1[q]
- i = i +1
- if List1[q] == 9998:
- run = False
- q = q + 1
- else:
- if List2[p] == List1[q]:
- print("Error",List2[p])
- else:
- List3[i] = List2[p]
- i = i +1
- p = p + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement