Python Program Write a program to calculate the sum of numbers from 1 to 20 which is not divisible by2, 3 ,4 or 5
Sum=0
print("Numbers from 1 to 20 which are not divisible by 2,3,4or 5")
for i in range(1,20):
if i%2==0 or i%3==0 or i%4==0 or i%5==0:
print(" ")
else:
print(i)
Sum=Sum+i
print('Sum of Even Numbers from 1 to 10 is=',Sum)
Comments
Post a Comment