0

I'm new to Python and wanted to know if there was a function that joins 2 lists together? I have:

list1 = [0, 1, 2] 
list2 = [3, 4, 5]

I want to quickly make a third list with list3 = [0,1,2,3,4,5]?

Jud
  • 1,324
  • 3
  • 24
  • 47

1 Answers1

0

To join lists you can run this:

list3 = list1 + list2

If you'd like to prevent duplicates in your list, use: list3 = list(set(list1 + list2))

Jud
  • 1,324
  • 3
  • 24
  • 47