BERKYT

Password Generator

Apr 5th, 2022 (edited)
1,492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import random
  2.  
  3. length = int(input('Enter length of password: '))
  4. origins = r'`;:1234567890!@#$%^&P{}[]<>,*()_+\./="-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  5.  
  6. list_password = [random.choice(origins) for _ in range(length)]
  7. password = ''.join(list_password)
  8.  
  9. print(password, file=open('pass.txt', 'a'))
  10. print(password)
  11.  
  12.  
  13. # one line:
  14. # print(''.join([random.choice('`;:1234567890!@#$%^&P{}[]<>,*()_+\./="-abcdefghijklmnopqrstuvwxyz' + 'abcdefghijklmnopqrstuvwxyz'.upper()) for _ in range(int(input('Enter length of password: ')))]))
  15.  
Add Comment
Please, Sign In to add comment