You are here: Home Blog Comments Re: キミならどう書く 2.0 - ROUND 1 -

Personal tools

Re: キミならどう書く 2.0 - ROUND 1 -

Posted by Dubhead at 2006-06-16 19:02

Pythonで、スライスと集合をむりやり使ってみる

MAX = 100 + 1

multiples = []
for n in range(2, MAX):
  multiples.extend(range(0, MAX)[2*n:MAX:n])
print set(range(2, MAX)) - set(multiples)

Parent entry キミならどう書く 2.0 - ROUND 1 -