Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://pastebin.com/u/TTpocToXaKep
- import random
- import string
- def generate_login(name):
- login = ""
- for i in range(len(name)):
- if i % 2 == 0:
- login += name[i].upper()
- else:
- login += name[i].lower()
- return login + str(random.randint(1000,9999))
- def generate_password(n):
- password = ""
- for i in range(n):
- password += random.choice(string.ascii_letters + string.digits)
- return password
- name = input('Введите имя: ')
- print('Логин:', generate_login(name))
- print('Пароль:', generate_password(8))
- file = open('data.txt', 'w')
- file.write("login:" + generate_login(name))
- file.write("pass:" + generate_password(8))
- file.close
- print("Сохранено в data.txt успешно!")
- print("При повторном использовании данные данные сотрутся!!")
- input("Чтобы выйти нажмите Enter:")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement