fork(2) download
  1. def intersecao(conjuntoA, conjuntoB):
  2. inter = [x for x in range(1,12) if x in conjuntoA and x in conjuntoB]
  3. return inter
  4.  
  5. a = [2,4,6,7,10]
  6. b = [3,4,6,8,10,11]
  7.  
  8. print(intersecao(a,b))
Success #stdin #stdout 0.01s 27664KB
stdin
Standard input is empty
stdout
[4, 6, 10]