Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #Generate a random alphanumeric password of givem length:
  2. import random
  3.  
  4. def passwordgenerator(x):
  5. password = []
  6. for i in range(x):
  7. password.append(random.choice("abcdefghijklmnopqrstuvwxyz1234567890"))
  8. #print(random.choice("abcdefghijklmnopqrstuvwxyz1234567890"))
  9. #password = password + (random.choice("abcdefghijklmnopqrstuvwxyz1234567890")
  10. i += 1
  11. return password
  12.  
  13. password = ''.join(map(str, passwordgenerator(8)))
  14. print(password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement