# Python 3.x
digits=range(35, 87 + 1)
required=[str(digit) for digit in digits if (digit % 7 == 1 or digit % 7 == 2 or digit % 7 == 5)]
print("Result:\n", '\n'.join(required))
# Python 3.x
digits=range(35, 87 + 1)
required=[str(digit) for digit in digits if (digit % 7 == 1 or digit % 7 == 2 or digit % 7 == 5)]
print("Result:\n", '\n'.join(required))