1.
- [4,2,8,6,5]
- Items from
a_list
are doubled before being placed inb_list
. - [8,4,16,12,10]
- Not all the items in
a_list
are to be included inb_list
. Look at the if clause. - 10
- The result needs to be a list.
- [10].
- Yes, 5 is the only odd number in
a_list
. It is doubled before being placed inb_list
.
What is printed by the following statements?
a_list = [4,2,8,6,5]
b_list = [num * 2 for num in a_list if num % 2 == 1]
print(b_list)