Revision 386561623765 () - Diff

Link to this snippet: https://friendpaste.com/1EXL0ANh3POv6UEO7oY50W
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sys
import string
import random

LETTERS = string.uppercase[:int(sys.argv[1])]
DIGITS = random.randint(0, int(sys.argv[2])]

winners = list()


try:

while True:
print raw_input("the next winner is...")
winner = "".join((random.choice(LETTERS), random.choice(DIGITS)))
print winner
winners.append(winner)

except KeyboardInterrupt:
print "Fin du tirage, rappel des winners:"
print ", ".join(winners)