Skip to content

Instantly share code, notes, and snippets.

@ildarkhasanshin
Forked from DOKL57/password.py
Created January 27, 2019 10:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ildarkhasanshin/aec24c301e9a2aaf5830444ccab0a4e5 to your computer and use it in GitHub Desktop.
Save ildarkhasanshin/aec24c301e9a2aaf5830444ccab0a4e5 to your computer and use it in GitHub Desktop.
Генератор паролей Python
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)
@PlutOnUA
Copy link

PlutOnUA commented Mar 5, 2022

👍

@EogoK
Copy link

EogoK commented Mar 29, 2022

👍

@snipsss
Copy link

snipsss commented Aug 1, 2022

tnx!

@nekitkirov
Copy link

good job

@xiepickx
Copy link

👍

@KaLiNkA-code
Copy link

👍

@EXG1O
Copy link

EXG1O commented Jan 22, 2023

password = ''
for i in range(8):
	password += random.choice('1234567890abcdefghigklmnopqrstuvyxwzABCDEFGHIGKLMNOPQRSTUVYXWZ')

@Transparency010101
Copy link

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}")

@diip888
Copy link

diip888 commented Jun 7, 2023

👍

@T1mple1
Copy link

T1mple1 commented Apr 23, 2024

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