Created
          May 18, 2017 14:39 
        
      - 
      
- 
        Save Everfighting/6d13935a342673e3032455b579266ce0 to your computer and use it in GitHub Desktop. 
    如何让字典保持有序
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from time import time | |
| from random import ranint | |
| from collections import OrderedDict | |
| d = OrderedDict() | |
| players = list('ABCDEFGH') | |
| start = time() | |
| for i in range(8): | |
| input() | |
| players.pop(randint(0,7-i)) | |
| end = time() | |
| print(i+1,p,end-start) | |
| d[p] = (i+1,end-start) | |
| print ('-'*20) | |
| for k in d: | |
| print(k,d[k]) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment