I have just started learning Python and everything has been going well so far, but I don't really know if I am doing terribly wrong or what's happening. My problem is, I have this code
Y="Y" and "y"
N="N" and "n"
Localname= (getpass.getuser())
print("Welcome User")
time.sleep(1)
print("Identificate")
print ("¿Are you " + Localname + "? (Y/N)")
nameuserauto = input ("> ")
while not nameuserauto == "Y" and "N" and "y" and "n":
print("INPUT ERROR, PLEASE USE (Y/N)")
nameuserauto = input("> ")
if nameuserauto == Y:
nominpu = Localname
print ("Name saved")
if nameuserauto == N:
print("Please, write your name")
nominpu = input("> ")
I just want to make the user have to input the answer again if it is not "Y", "N", "n" or "y". I tried several things, like changing "y" and the caps by variables and that didn't work (I am not sure that would work, though). I am fairly new on this and I couldn't see any similar question. Please help.