Advertisement
timber101

Password Generator

Dec 22nd, 2020
632
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None
  1. #  Password generator function
  2.  
  3. from random import choice
  4.  
  5. eligchars = ["A", "B", "C", "D","a", "b", "c", "d", "£", "-", ">"]
  6.  
  7. def pwgenerator(nochar):
  8.     pw = ""
  9.     for i in range(nochar):
  10.         pw = pw + choice(eligchars)
  11.    
  12.     print ("your password of is " + pw)
  13.     #print (f "your password is {pw}") ### doesnt work, wonder why?
  14.        
  15.    
  16.  
  17. pwgenerator (int(input("please enter password length >")))
  18.  
Advertisement
RAW Paste Data Copied
Advertisement