I guess the code will most easily explain what I'm going for...
list1 = [("1", "Item 1"), ("2", "Item 2"), ("3", "Item 3"), ("4", "Item 4")]
list2 = [("1", "Item 1"), ("2", "Item 2"), ("4", "Item 4")]
newlist = []
for i,j in list1:
if i not in list2[0]:
entry = (i,j)
newlist.append(entry)
print(newlist)
if we call the nested tuples [i][j]
I want to compare the [i] but once this has been done I want to keep the corresponding [j] value.
I have found lots of information regarding nested tuples on the internet but most refer to finding a specific item.
I did recently use an expression below, which worked perfectly, this seems very similar, but it just won't play ball.
for i,j in highscores:
print("\tPlayer:\t", j, "\tScore: ", i)
Any help would be much apppreciated.
list1andlist2above, what would you like to be innewlistafter everything is all finished?