Advertisement
Antypas

Password generator

Apr 11th, 2020
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import random
  2.  
  3. mylist = ['a','b','c','d','e','f','g','h',1,2,3,4,5,6,7,8,9]
  4.  
  5. def password_gen(length, list):
  6.     mychoices = random.choices(list, k =length)
  7.     pw = " "
  8.     for index in range(len(mychoices)):
  9.         pw =pw+str(mychoices[index])
  10.     return pw
  11.  
  12. print(password_gen(16, mylist))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement