Code keeps outputting error

from string import punctuation
set(punctuation)
('~', ':', "'", '+', '[', '\\', '@', '^', '{', '%', '(', '-', '"', '*', '|', ',', '&', '<', '`', '}', '.', '_', '=', ']', '!', '>', ';', '?', '#', '$', ')', '/')
attempts = 1
password1 = str(input("Enter a password over 8 characters and use special characters: "))
while len(password1) < 8:
    print("Password too short.")
    password1 = str(input("Enter a password over 8 characters and use special characters: "))
while any(punctuation not in password1):
    print("Weak password. ")
    password1 = str(input("Enter a password over 8 characters and use special characters: "))
print("Strong password.")

when it gets to line 11 ( while any(punctuation not in password1): ) it keeps outputting:

Traceback (most recent call last):
  File "<string>", line 11, in <module>
TypeError: 'bool' object is not iterable

Welcome to the forums. A few things first:

  • please format your code
  • please link to the lesson

Further: