Akevitt til julebord!

This commit is contained in:
2017-12-19 16:20:07 +01:00
parent 48f85b4a97
commit ee60a0624a
2 changed files with 19 additions and 1 deletions

16
luke_10/julebord.py Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python3.6
def main():
participants = list(range(1, 1501))
while len(participants) > 1:
for pers in participants:
try:
participants.pop(participants.index(pers) + 1)
except IndexError:
participants.pop(0)
return participants.pop()
if __name__ == '__main__':
main()

View File

@@ -1,2 +1,4 @@
from luke_10.julebord import main
def test_answer():
assert False
assert main() == 953