Calculate the first 50 perfect cubes and store them in a list. Do not calculate them individually with fifty separate calculations. Use a loop. Each time through the loop, the program should calculate a perfect cube and append it to the list. 2. Use another loop to traverse the list and display the numbers in order.
for i in (perfectCubes=[c**3 for c in range(50)]):
print(i)
Comments
Leave a comment