Let's see how we can create an empty list:
<Variable name > = []
List1 = []
Let's see how we can create an empty list:
<Variable name > = []
List1 = []
A list contains comma-separated values. For example:
Avengers = ['hulk', 'iron-man', 'Captain', 'Thor']
You can assign a list value to variables by using the assignment operator. Let's discuss this with an example:
>>> a,b = [1,2]
>>> a
1
>>> b
2
>>>
You can see that 1 is assigned to variable a and 2 is assigned to variable b. This is called unpacking. What...