Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- length = int(input('Enter length of password: '))
- origins = r'`;:1234567890!@#$%^&P{}[]<>,*()_+\./="-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
- list_password = [random.choice(origins) for _ in range(length)]
- password = ''.join(list_password)
- print(password, file=open('pass.txt', 'a'))
- print(password)
- # one line:
- # print(''.join([random.choice('`;:1234567890!@#$%^&P{}[]<>,*()_+\./="-abcdefghijklmnopqrstuvwxyz' + 'abcdefghijklmnopqrstuvwxyz'.upper()) for _ in range(int(input('Enter length of password: ')))]))
Add Comment
Please, Sign In to add comment