Write a Python program that calculates the sum of all numbers from 1 to 100 (inclusive) that are divisible by both 3 and 5. Use a for loop and a variable total to store the sum.
Added by Juan Antonio G.
Step 1
This variable will be used to store the sum of all numbers from 1 to 100 that are divisible by both 3 and 5. ```python total = 0 ``` Show more…
Show all steps
Your feedback will help us improve your experience
Shelayah Robinson and 87 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Python code Write a complete program with for loop which calculates the sum of the numbers from 1 to 100
Willis J.
Write a python program to find the sum of first 100 natural numbers using loop.
Write a Python program that displays all integers between 1 and 100 that are divisible by 5 or 7, but not both. Write it using While and for.
Shaik D.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD