Q.

Write a list comprehension for number and its cube for l=[1, 2, 3, 4, 5, 6, 7, 8, 9].

A. [x**3 for x in l]
B. [x^3 for x in l]
C. [x**3 in l]
D. [x^3 in l]
Answer» A. [x**3 for x in l]
Explanation: the list comprehension to print
2k
0
Do you find this helpful?
5

Discussion

No comments yet