view problem1.py @ 14:49c96972949d default tip

#50 rewrite of solution
author Dominic Cleal <dominic@computerkb.co.uk>
date Mon, 01 Dec 2008 19:11:55 +0000
parents 1ca695e32f66
children
line wrap: on
line source

skips = [3,2,1,3,1,2,3]
s = 0

tot = 0
i = 0

while i<1000:
	tot += i
	i += skips[s]
	s += 1
	if s==len(skips):
		s = 0

print tot