1
I am writing a program that merges the values of two arrays, with the same amount of values. The program receives as input amount of values in each array. It then takes the values and at the end prints the intercalated values, as follows:
Entree:
3
2
7
5
9
6
8
Exit:
2
9
7
6
5
8
Like I’m doing:
quantidade = int(raw_input())
inicio = 0
lista1 = list()
while inicio < quantidade:
valor = int(raw_input())
inicio = inicio + 1
lista1.append(valor)
My code creates a list of the values received, but I don’t know how to create the two lists, nor how to intermediate the values. How to proceed?
You want to join two lists?
– gato
I want to parse the values of the lists. The amount of values in each list must be provided by the user at the beginning. Example: List 1 = [1, 2, 3], List 2 = [4, 5, 6], List of intercalated values = [1, 4, 2, 5, 3, 6].
– Guilherme Santana De Souza