ismaelvc

key_generator.py

Aug 30th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import random
  4.  
  5.  
  6. def generador():
  7.         lista0 = ["p", "g", "q"]
  8.     lista1 = ["a", "o", "e"]
  9.     lista2 = ["m", "h", "c"]
  10.  
  11.     d0 = random.randint(1, 9)
  12.     d1 = random.choice(lista0)
  13.     d2 = random.randint(10, 100)
  14.     d3 = random.choice(lista1)
  15.     d4 = random.choice(lista2)
  16.  
  17.     return '{0}{1}{2}{3}{4}'.format(d0, d1, d2, d3, d4)
  18.  
  19.  
  20. def main():
  21.     key = generador()
  22.     print('Key: {0}'.format(key))
  23.  
  24.  
  25. if __name__ == '__main__':
  26.     main()
Advertisement
Add Comment
Please, Sign In to add comment