Skip to content

Commit 7bfffd4

Browse files
authored
Update how.py
1 parent e8dde66 commit 7bfffd4

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

123/how.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Created by lifedestroyed & ld.team, 2025. https://github.com/lifedestroyed/ & https://teamld.github.io/
2-
31
import random
2+
import string
43

54
# Приветствие
65
def greet():
@@ -22,6 +21,12 @@ def greet():
2221
# Словарь для хранения паролей
2322
passwords = {}
2423

24+
# Функция для генерации случайного пароля
25+
def generate_random_password(length=12):
26+
characters = string.ascii_letters + string.digits + string.punctuation
27+
password = ''.join(random.choice(characters) for _ in range(length))
28+
return password
29+
2530
# Функции для управления рейтингами фильмов
2631
def show_movies():
2732
print("Список фильмов и их рейтинги:")
@@ -63,9 +68,9 @@ def show_passwords():
6368

6469
def add_password():
6570
name = input("Введите название для пароля: ")
66-
password = input("Введите пароль: ")
71+
password = generate_random_password()
6772
passwords[name] = password
68-
print("Пароль для '{}' добавлен.".format(name))
73+
print("Пароль для '{}' добавлен: {}".format(name, password))
6974

7075
def remove_password():
7176
name = input("Введите название пароля для удаления: ")

0 commit comments

Comments
 (0)