Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import string, random
- alpha = 'abcdefghijkljmnopqrstuvwxyz0123456789'
- x = 0
- pwd = ""
- hasint = 0
- charpos = 0
- chrmin = 0
- chrmax = len(alpha) - 1
- while x < 9:
- charpos = random.randint(chrmin,chrmax)
- char = alpha[charpos]
- up = random.randint(0,1)
- if up:
- char = char.upper()
- pwd = "%s%s" % (pwd, char)
- if char.isdigit():
- hasint = 1
- x = x+1
- if hasint is 0:
- charpos = random.randint(0,8)
- pwdlist = list(pwd)
- pwdlist[charpos] = str(random.randint(0,9))
- pwd = ''.join(pwdlist)
- print pwd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement