Python program to find the sum and divide and check reminder : 
I want a python or a shell script to find the sum of numbers of a particular range. and divide it by 8. and if the reminder is between 1 to 4 print that number.

Example. 

5959

5+9+5+9 = 28

Reminder of 28 / 8 is 3 .

3 comes in the range of 1 to 4. so print the number 5959 and go to next number. if reminder is not in the range of 1 to 4 ignore and go to next number.

So far i have tried this. but not happening

count = 0

lower = 5959

while (count<1000):

 sum_digit= lower%8

 count+=1

 lower+=1

 if 1<=sum_digit<=4:

  print lower
