Here is a mistake

File "source_file.py", line 13 print ("error password") ^ IndentationError: expected an indented block

Here is the code

spisok=("netstalker", "hacker", "programmist", "admin") name=input("enter your username ") if (name in spisok): print ("hello", name) password=("qwerty123456") passw=input("input password: ") if (passw in password): print ("complite") else: print ("error password") else: print ("error") 

Closed due to the fact that off-topic participants Enikeyschik , Dmitry Kozlov , aleksandr barakin , 0xdb , LFC January 27 at 9:01 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Enikeyschik, Dmitry Kozlov, aleksandr barakin, LFC
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    And what is the question? The text of the error is incomprehensible or is it unclear how to add four spaces to the line? - Enikeyschik

2 answers 2

The error means that the indents in the code are violated, and specifically in the line print ("error password")

That's right:

 spisok = ("netstalker", "hacker", "programmist", "admin") name = input("enter your username ") if name in spisok: print("hello", name) password = "qwerty123456" passw = input("input password: ") if passw == password: print("complеte") else: print("error password") else: print("error") 

Ps.

A little combed code

Pps.

To enter passwords, I recommend using not input , but getpass :

 from getpass import getpass ... passw = getpass("input password: ") 
     spisok = ["netstalker", "hacker", "programmist", "admin"] name = input("Enter your username: ") if name in spisok: print ("hello", name) password = "qwerty123456" passw = input("Input password: ") if passw == password: # == , НО НЕ in print("complite") else: print("error password") # !!! else: print ("error") 

    The mistake was that the tab was omitted in the else body. Also, if you want to check if the 2 values ​​are the same, use the == operator instead of in . The latter is used to check for entries in the data array.

     "a" in "abcd" # True 4 in [1,2,3,5] # False 
    • passw in password done, you noticed an error with passw in password :) - gil9red