List Compare

Create a program using python that performs the following;

- Creats a program that compares to lists and outputs all the numbers that are not common in both lists.

- lista = [1, 3, 5 ,7 ,9, 11, 13]

- listb = [2, 3, 4, 6, 7, 8, 10, 11, 12]​

Respuesta :

def func(lst1, lst2):

   uncommon_lst = []

   for i in lst1:

       if i not in lst2:

           uncommon_lst.append(i)

   return uncommon_lst

lista = [1, 3, 5 ,7 ,9, 11, 13]

listb = [2, 3, 4, 6, 7, 8, 10, 11, 12]

print(func(lista, listb))

I hope this helps!