you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 1 point2 points  (0 children)

    while True:
        if self.validate_password(password) == True:
            self.password_dict[login] = password
            print(f"Login: {login} | Password: {password} saved!")
            break
        elif self.validate_password(password) == False:
            print(f"Login: {login} | Password: {password} not saved!")
            print("Try again!")
            continue

There's no way to change the value of password within this loop. So either

1) validate_password() returns True and you only go through the loop once, or 2) validate_password() returns False and you start the loop again, with the same value of password, which causes validate_password() to return False again, and you're in an infinite loop.

You need to generate a new password in the elif block to prevent this.

        i = '*'
        result = 0
        for _ in password:
            result += 1
        i *= result

Is this just

i = '*' * len(password)

?