mirror of
				https://github.com/KevinMidboe/knowit_julekalender-2018.git
				synced 2025-10-29 17:50:19 +00:00 
			
		
		
		
	Akevitt til julebord!
This commit is contained in:
		
							
								
								
									
										16
									
								
								luke_10/julebord.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								luke_10/julebord.py
									
									
									
									
									
										Executable 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() | ||||
| @@ -1,2 +1,4 @@ | ||||
| from luke_10.julebord import main | ||||
|  | ||||
| def test_answer(): | ||||
|    assert False | ||||
|    assert main() == 953 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user