Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import random
- os.system("cls")
- usernameList = []
- passwordList = []
- while True:
- fullName = input("Nome completo: ")
- # encerra loop
- if fullName == '1':
- os.system("cls")
- break
- splitFullname = fullName.split()
- username = splitFullname[0][:1] + splitFullname[1]
- if username in usernameList:
- print("Usuário " + username + " já cadastrado\n")
- else:
- usernameList.append(username)
- # gera senha temporária
- i = 1
- password = ""
- while i <= 8:
- asciiValue = random.randint(33,255)
- password = password + chr(asciiValue)
- i+=1
- passwordList.append(password)
- # imprime resultados
- print("Lista de usuários\n\n")
- for username in usernameList:
- print(username)
- for password in passwordList:
- print(password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement