Programming Examples

Python program to calculate the sum of odd numbers divisible by 5 from the range 1 to 100


write a program to calculate the sum of odd numbers divisible by 5 from the range 1..100

Solution

sum=0
for i in range (1,101,2):
    if i%5==0:
        sum=sum+i
print("Sum of odd numbers divisible by 5 from range 1 to 100 is : ",sum)
Output

Sum of odd numbers divisible by 5 from range 1 to 100 is :  500

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz