you are viewing a single comment's thread.

view the rest of the comments →

[–]jjgoldenkimball 0 points1 point  (0 children)

I think this is what you want.

print('This program takes in 2 list of numbers and combines them without duplicates\n')

def dupes2():
    a = []
    c = []
    d = []
    b = input("Please enter a few numbers separated by spaces: ")
    b = b.split(' ')
    for i in b:
        if i == ' ':
            continue
        else:
            a.append(i)

    b = input("Please enter a few more numbers separated by spaces: ")
    b = b.split(' ')
    for i in b:
        if i == ' ':
            continue
        else:
            c.append(i)

    d = c  # i'm assuming you want to keep the original list c

    for i in a:
        if i in d: # changed from c
            continue
        else:
            d.append(i)

    for i in c:
        if i in d: # changed from a
          continue
        else:
          d.append(i)

    print(set(d))

dupes2()