adplus-dvertising
frame-decoration

Question

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]

Posted under Python

Answer: (a).[x**3 for x in l]

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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