I am trying to make a program using python that takes 2 separate lists and compares them to see the things in the list that match and output the ones that are in the first list but not in the second list. This is what i have so far (it doesn't work properly):
list1 = ("hello","goodbye","one","two","three") list2 = ("hello","one","two") for name in followers: if name == follow: continue print(name) i want it to print the word that ARE in list1 but AREN'T in list2. can someone please help. i have been searching but haven't found the right answer so far. any help would be appreciated!
https://stackoverflow.com/questions/65622424/how-to-print-the-words-that-arent-in-both-lists-using-python January 08, 2021 at 09:59AM
没有评论:
发表评论