Question: 7. Using list comprehension, write single Python statements to create the lists given below and store them in a variable mylist. a) [1, 2, 3,
7. Using list comprehension, write single Python statements to create the lists given below and store them in a variable mylist. a) [1, 2, 3, 4, 5, 6, 7, 8, 9]
b) [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
c) [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
d) [1, 4, 16, 25, 49, 64, 100]
e) [1, 8, 27, 64, 125, 216, 343, 512, 729, 1000]
f) [[1, 1], [2, 4], [3, 9], [4, 16], [5, 25], [6, 36], [7, 49], [8, 64], [9, 81], [10, 100]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
