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/ Explanation:
Sum of odd numbers divisible by 5 from range 1 to 100 is : 500