-
-
Save ildarkhasanshin/aec24c301e9a2aaf5830444ccab0a4e5 to your computer and use it in GitHub Desktop.
Генератор паролей Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
num = input('login ') | |
pas = '' | |
for x in range(16): #Количество символов (16) | |
pas = pas + random.choice(list('1234567890abcdefghigklmnopqrstuvyxwzABCDEFGHIGKLMNOPQRSTUVYXWZ')) #Символы, из которых будет составлен пароль | |
print('Hello, ', num, 'your password is: ', pas) |
👍
tnx!
good job
👍
👍
password = ''
for i in range(8):
password += random.choice('1234567890abcdefghigklmnopqrstuvyxwzABCDEFGHIGKLMNOPQRSTUVYXWZ')
import random
from string import printable # Тут все символы
size_of_password = int(input("Length: "))
password = ""
for i in range(size_of_password):
password += random.choice(list(printable))
print(f"Your password: {password}")
👍
my version
import random
letter = ""
num = input("number of characters in the password ")
for i in range(int(num)):
chars = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
letter = letter + random.choice(chars)
print(letter)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍