Created
July 25, 2010 15:33
-
-
Save vvoody/489641 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 | |
a = [] | |
def bingo(n): | |
b = [] | |
while len(b) < n: | |
s = random.randint(0,120) | |
if s in a: | |
continue | |
b.append(s) | |
a.append(s) | |
return b | |
# 抽奖程序,print bingo(N)选出N为获奖者 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment