I keep getting the following error and I can't seem to find a solution for it.

```
    if password not in old_passwords:
TypeError: argument of type 'PasswordManager' is not iterable

```

For clarity, I needed to create a class called 'PasswordManager'. The class should have a list called 'old\_passwords'. The list contains all past passwords, the last index of the list should be the current password. The required methods are 'set\_password', 'get\_password' and 'is\_correct'.

'get\_password' should return the current password.

'set\_password' sets a new password. It should only change the password if the attempted password is different from all the user’s past passwords.

'is\_correct' receives a string and returns a boolean True or False depending on whether the string is equal to the current password or not.

```
class PasswordManager():
    old_passwords = []
    def get_password(old_passwords):
        return old_passwords[len(old_passwords-1)]

    def set_password(old_passwords, password):
        if password not in old_passwords:
            old_passwords.append(password)

    def is_correct(old_passwords, password):
        if password == old_passwords[len(old_passwords-1)]:
            return True
        else:
            return False

```

Does anyone have an idea that could help me? Thanks in advance!