~ Load two arrays of integers of N and M positions. ~ It is requested to generate a program that produces the intersection between the two arrangements.
a = []
b = []
n1 = int(input("Ingrese la cantidad de elementos del primer arreglo: "))
n2 = int(input("Ingrese la cantidad de elementos del segundo arreglo: "))
for i in range(0,n1):
a.append(int(input("Ingrese un numero para primer vector: ")))
for i in range(0,n2):
b.append(int(input("Ingrese un numero para segundo vector: ")))
Hi, I'm starting to program in python and I get stuck in this exercise. My drawback is the intersection between the array a and b. I have to remove the elements that have in common both vectors but I have no idea how to do it. I thought about joining both arrangements in oneself and asking if there are more equal numbers but I think that the previous elements are going to take new positions, which I do not want. What condition should I ask to take out the repeated numbers?