Tuesday, June 26, 2012

Re: Generating random alphanumeric codes

El 26/06/12 10:13, Adrian Bool escribió:

On 26 Jun 2012, at 15:53, Sithembewena Lloyd Dube wrote:
Would anyone have tips on how to generate random 4-digit alphanumeric codes in python? Also, how does one calculate the number of possible combinations?

mm... if I undertand you, maybe this could be useful:

http://docs.python.org/library/itertools.html

specially the combinations

http://docs.python.org/library/itertools.html#itertools.combinations

PV
--   patoVala  Linux User#280504  Hablando en http://www.elprimoalcahuete.com  "The difference between a good haircut and a bad one is seven days."  +--[ DSA 1024]----+  |     .o..        |  |     .oo..       |  |   . =...    .   |  |  . = + ... o .  |  |   *   .S= + o   |  |  . .   o = E    |  |         . o     |  |                 |  |                 |  +-----------------+  

No comments:

Post a Comment