Skip to content

Instantly share code, notes, and snippets.

@fegvilela
Last active March 28, 2022 13:43
Show Gist options
  • Save fegvilela/652145e15d64a513d338d735729bb7c3 to your computer and use it in GitHub Desktop.
Save fegvilela/652145e15d64a513d338d735729bb7c3 to your computer and use it in GitHub Desktop.
Diff between two lists
list1 = [1, 2, 4]
list2 = [4, 5, 6]
set_difference = set(list1) - set(list2)
list_difference = set(list1).symmetric_difference(set(list2))
print(list_difference)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment