Apr-28-2021, 01:17 PM
This is one way to get these results:
Example:
- convert the lists to sets,
- take the union of all three sets
- convert union to set
- then convert that set to a list
- sort the list
Example:
taba = ['aligators','bats','eagles'] tabb = ['bats','cats','eagles'] tabc = ['cats','dogs','eagles'] tlist = list(set(set(taba).union((set(tabb).union(set(tabc)))))) tlist.sort() print(f"tlist: {tlist}")
Output:tlist: ['aligators', 'bats', 'cats', 'dogs', 'eagles']