view problem1.py @ 2:1ca695e32f66

Solutions from tungsten
author Dominic Cleal <dominic@computerkb.co.uk>
date Mon, 01 Dec 2008 10:57:01 +0000
parents
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