BenTibnam

Random Password Program For RBPM

Mar 4th, 2022 (edited)
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. # Script for use in RBPM @ https://pastebin.com/C5Ye98S9
  2.  
  3. from random import randrange
  4.  
  5. alpha = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsRrTtUuVvWwXxYyZz123456789"
  6. passw = ""
  7.  
  8. ncharacters = int(input("How many characters do you want in the password: "))
  9. addSymbol = input("Do you want to add a symbol: ").lower()[0]
  10.  
  11. for i in range(1, ncharacters):
  12.         ch = alpha[randrange(0, len(alpha))]
  13.         passw += ch
  14.  
  15. if addSymbol == 'y':
  16.         symbols = "@%+\\/'!#$^?:.(){}[]~_."
  17.         sy = symbols[randrange(0, len(symbols))]
  18.         passw += sy
  19.  
  20. print(passw)
Add Comment
Please, Sign In to add comment