fork download
  1. def op(e1, e2):
  2. return e1 % 2 == 0 and e2 % 2 == 1
  3.  
  4. def OpCojuntos(L1, L2):
  5. L3 = []
  6. for i in range(len(L1)):
  7. for j in range(len(L2)):
  8. if op(L1[i], L2[j]):
  9. L3.append((L1[i], L2[j]))
  10. return L3
  11.  
  12. L1 = [1, 2, 3, 4, 5]
  13. L2 = [6, 7, 8, 9, 10]
  14. print(OpCojuntos(L1, L2))
  15.  
Success #stdin #stdout 0.03s 9688KB
stdin
Standard input is empty
stdout
[(2, 7), (2, 9), (4, 7), (4, 9)]