Difference among list, tuple and set in Python and when to use each one

Python has three similar data structures that can hold an unordered collection of elements: list, tuple and set. Here's how they differ: initialization list: using the built-in list() or the square brackets ([]): list1 = list() # creates an empty list list2 = [] # also creates an empty list list3 = ['a', 'b', 'c', … Continue reading Difference among list, tuple and set in Python and when to use each one