def primegen(maximum): v = range(2, maximum) while v: p = v[0] v = filter(int(p).__rmod__, v) yield p
Re:キミならどう書く 2.0 - ROUND 1 -
def primegen(maximum):
v = range(2, maximum)
while v:
p = v[0]
v = filter(int(p).__rmod__, v)
yield p