Answer to Question #262041 in Python for Isabel Cortez

Question #262041

3. Not my Favorites

by CodeChum Admin



Instructions:

  1. Print out the cube values of the numbers ranging from 1 to 1000 (inclusive). However, if the number is divisible by either 3 or 5, do not include them in printing and proceed with the next numbers.
  2. Tip: When skipping through special values, make use of the keyword continue and put them inside a conditional statement.



Output

Multiple lines containing an integer.

1
8
64
343
512
.
.
.
1
Expert's answer
2021-11-06T11:48:19-0400
for i in range(0, 1001):
    if i % 5 == 0 or i % 3 == 0:
        continue
    print(i*i*i)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS