0

Hi, I'm a newbie on programing Hello, I want to make an app register. But I've got problem with sending the person back who got incorrect password print to the back. I considered the "while" to use with. Could you guys help me please?

#Pochighoo App


#registiration side

from ast import While
from asyncore import loop
from random import randint

from time import sleep
from turtle import back, backward

#description part
print("Hi, this is Burak who made this app named Pochighoo.\n In this app, we'll be able to use several feaute.\n Let's start with making your account ready to use up. ")
sleep(randint(4,5))

#register side
userNAME = input("Choose a username:",)
passwd = input("Choose a password:",)

sleep(randint(3,5))

#login side
usrlogin = input("Enter your username:",)
passwdLogin = input("Enter your password:",)


if **usrlogin** == userNAME and passwd == passwdLogin:
    print("Welcome to Pochinghoo!")
    print("Username or password that you entered is incorrect, please try again.")

While usrlogin != userNAME or passwdLogin != passwdLogin

print(" how are you doing?")

These give me an error as: enter image description here

the error appears for the bolded below: if **usrlogin** == userNAME and passwd == passwdLogin:

I'm saying that how can I solve that problem?

Karoob
  • 11
  • 1
    Bolding doesn't work in code segments. – Charles Duffy Oct 29 '22 at 23:03
  • 1
    Anyhow -- the `if` looks fine. The `while` is clearly wrong -- it needs to be `while` not `While`, it needs to have a `:` at the end of it, and there needs to be content _inside_ of it. (Also, `while` isn't a class at all; it's a flow control construct). Probably you want to move the `while` _above_ where you currently have the `if`, make sure you allow new input _inside_ the `while` loop so the user can try to correct their mistake, and then take out the `if` condition altogether, since the `while` will only be exited when the username and password are correct. – Charles Duffy Oct 29 '22 at 23:04
  • 4
    You don't need to import `While` from `ast` unless you're doing something wild with reflection. In fact, if you're just starting out in Python, you don't need to *touch* the `ast` module for a long time. – Silvio Mayolo Oct 29 '22 at 23:06
  • _nod_. The `ast` module is not just for experts only; it's for experts doing something unusual and weird. (Building a language that compiles to Python, for example, or writing a tool like 2to3, or building a new static checker) – Charles Duffy Oct 29 '22 at 23:20

0 Answers0