Answer to Question #321388 in Python for JoJo

Question #321388

Calculate and display the sum of all the numbers divisible by 7 between 18 and 534 using loops and conditional statements i.e. 21+28+35+...+525+532.



1
Expert's answer
2022-06-16T07:48:05-0400
total=0
n=18


while n<534:
    if not n%7:
        total+=n
    n+=1
print ('The sum of all the numbers divisible by 7 between 18 and 534 is {}.'.format(total))

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