Skip to content

Instantly share code, notes, and snippets.

@bussiere
Created May 25, 2011 17:10
Show Gist options
  • Save bussiere/991386 to your computer and use it in GitHub Desktop.
Save bussiere/991386 to your computer and use it in GitHub Desktop.
euro.py
import random
grilleA = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]
grilleB = [1,2,3,4,5,6,7,8,9,10,11]
grilleta = [42]
grilletb = [4]
# and len(grilletb) < 2 :
while len(grilleta) < 5 :
tiragea = random.randint(0,len(grilleA)-1)
if grilleA[tiragea] not in grilleta :
grilleta.append(grilleA[tiragea])
del grilleA[tiragea]
grilleta.sort()
while len(grilletb) < 2 :
tirageb = random.randint(0,len(grilleB)-1)
if grilleB[tirageb] not in grilletb :
grilletb.append(grilleB[tirageb])
del grilleB[tirageb]
grilleta.sort()
grilletb.sort()
print grilleta
print grilletb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment