Okay!
I wrote some code. It is below so that you can avoid scrolling down and
seeing it if you do not want to see any code!
HTH
Asokan
people = list(" ABCDEFGHIJKLMN")
COUNT = len(people)
remove = 3
SPACE = ' '
def survivorCount(a):
return len(a) - a.count(SPACE)
pos = 0
men = 0
while survivorCount(people) != 1:
if people[pos] != SPACE:
men += 1
if men % remove == 0:
print "removed", people[pos], "at", pos
people[pos] = SPACE
pos = (pos + 1) % COUNT
print ''.join(people).strip()
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor