#!/usr/bin/env python3 # # # Copyright (c) 2021, Hiroyuki Ohsaki. # All rights reserved. # # $Id: num-filter.py,v 1.1 2021/11/15 10:59:17 ohsaki Exp $ # def is_interested(n): """Return True if the number N is interested.""" if n % 2 == 0: return False elif n % 3 == 0: return False elif n % 10 in [0, 5]: return False return True def main(): # Find interested numbers between 1 and 100. interested = filter(is_interested, range(1, 100 + 1)) for n in interested: print(n) if __name__ == "__main__": main()