Created
April 26, 2020 03:24
-
-
Save ilhamije/01afd219f4419c7e15b3bc07c69df47b to your computer and use it in GitHub Desktop.
JDS-ilham-DE-Python-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unique_names(names1, names2): | |
names1_set = set(names1) | |
names2_set = set(names2) | |
return list(names1_set.union(names2_set)) | |
names1 = ["Ava", "Emma", "Olivia"] | |
names2 = ["Olivia", "Sophia", "Emma"] | |
print(unique_names(names1, names2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment