Write a list comprehension for number and its cube


Topic: Write a list comprehension for number and its cube

Solution

l=[1, 2, 3, 4, 5, 6, 7, 8, 9]
print([x**3 for x in l])



List all Python Programs