0
I hope you are well! I have tried to make a system that asks for registration and that after confirmation of it, walks to the login screen. Soon after doing the same, new options will appear. The question is: I CAN’T LEAVE THIS PART! Below is the code:
#coding: utf8
#Criado por: Lorran Rocha dos Santos
#--------------BOAS VINDAS--------------#
print("Bem-Vindo!")
welcome = input("Você já tem uma conta? S/N ")
#--------------VERIFICAR ESCOLHA--------------#
def cadastro(welcome, username, email, cpf, endereco,celular,password,password1):
if welcome == "n" or "N":
while True:
username = input("Digite um Nome de Usuario:")
email = input("Digite seu email:")
cpf = input("Digite seu CPF:")
endereco = input("Digite seu endereço completo:")
celular = input("Digite seu numero de celular:")
password = input("Digite uma Senha:")
password1 = input("Confirme sua Senha:")
if password == password1:
file = open(username+".txt", "w")
file.write(username+":"+password)
file.close()
welcome = "s"
break
print("As senhas não batem!")
def login():
if welcome == "s" or "S":
while True:
login1 = input("Login:")
login2 = input("Senha:")
file = open(login1+".txt", "r")
data = file.readline()
file.close()
if data == login1+":"+login2:
print("Bem-Vindo!")
break
print("Usuário ou Senha incorretos.")
But what would I call the function?
– Lorran Rocha
only
login()
As the functionlogin
no brackets, just call with two curved brackets with nothing in the middle. When a function has parameters, it has to put:funcao(param1, param2)
– João Castilho
You saved me! Thank you!
– Lorran Rocha
Do not worry, if you need more help, let us know! Give upvote if it helped, accept the answer if your questions are clarified!
– João Castilho
Here just keeps saying that the "break" is out of the loop. I try several types of endentation and nothing...
– Lorran Rocha
Put your current code
– João Castilho
Let’s go continue this discussion in chat.
– João Castilho