by CodeChum Admin
We've already done looping through a series of numbers and printing out its squares, so how about we level it up and go with cubes this time?
I have a condition though; I don't want to be associated with numbers that are divisible by 3 or 5 so if an integer is divisible by either of the two, don't make their cube values appear on the screen, please.
Care to fulfill my request?
Instructions
Output
Multiple lines containing an integer.
1
8
64
343
512
.
.
.
for i in range(0, 1001):
if i % 5 == 0 or i % 3 == 0:
continue
print(i*i*i)
Comments
Leave a comment