Probably very easy, but cant figure it out I just started learning python and the whole programming.
So I have a range of numbers and want to to know how many of those numbers are divisible with 2 or 5 or 7.
Funny as the code shows I can get the sum of those numbers. But how to get the numbers of them?
In this range its 2,4,5,6,7,8,10 so I need the number 7, 7 numbers exist in the range that are ok with the condition.
x=0
for i in range(1,11):
if i%2 == 0 or i%5 == 0 or i%7==0 :
x+=i
print(x)