Created
June 8, 2014 01:50
-
-
Save onesuper/2faf976ffad21a0248e7 to your computer and use it in GitHub Desktop.
This file contains 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
import random | |
class Pool: | |
def __init__(self, names): | |
self.names = names | |
def pick(self): | |
if len(self.names) == 0: | |
return | |
i = random.randint(0, len(self.names)-1) | |
picked = self.names[i] | |
del self.names[i] | |
return picked | |
pool_Z = Pool(["Wang Tao", "Zhang Haibo"]) | |
pool_A = Pool(["Chen Zhitao", "Cheng Yichao", "Peng Yi", "Ding Yadong"]) | |
pool_B = Pool(["Wang Zhaohui", "Zhang Aimin", "Sun Chuanwei", "Liang Weihao"]) | |
pool_C = Pool(["Gaoxao Chuan", "Fang Guoqin", "Qiu Xiaojie", "TBD"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment