a_list = [1, 2, 3] a_list = [item * 2 for item in a_list] print(a_list) OUTPUT [2, 4, 6]
Here is what the above code is Doing:
1. We create a list called a_list.
2. We create a list comprehension that multiplies each item in a_list by 2.
3. We print the new list.