jy166102 发表于 2018-8-13 11:34:22

python字典保持有序

from collections import OrderedDict  
from time import time
  
from random import randint
  

  
player = list('ABCDEFGH')start = time()for i in xrange(8):
  
    raw_input()# 程序阻塞,系统时间仍执行
  
    p = player.pop(randint(0, 7 - i))    end = time()
  
    print i + 1, p, end - start
  
    d = (i + 1, end - start)for k in d:
  
    print k, d
页: [1]
查看完整版本: python字典保持有序