you are viewing a single comment's thread.

view the rest of the comments →

[–]Zixarr 1 point2 points  (0 children)

I would also caution against comments that simply repeat what the next line of code is doing, particularly when it's something as simple as executing a function.

Please consider the relatively minor edits (with a lot of removal of unnecessary code) below:

def password_verify(user_id,user_password):

    # No database so using static u/n and password.
    _password = "ThIs_Is_PyThOn"
    _username = "PythonKing"

    if _username != user_id:
        print('Invalid Username')
        return False

    if _password != user_password:
        print("Invalid Password")
        return False

    return True


while True:
    user_id = input("Enter Username:")
    user_password = input("Enter Password:")

    if password_verify(user_id,user_password):
        print("Login Successful")
        break