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 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad