while True:
profilePassword = input("Password: ")
if profilePassword == "":
print("Your password can't be blank!")
continue
else:
pass
for n in profilePassword:
if n == " ":
print("Your password can't contain spaces!")
break
elif n not in "1234567890":
print("Your password has to contain at least one number!")
break
elif n not in "abcdefghijklmnopqrstuvwxyz":
print("Your password has to contain at least one lowercase letter!")
break
elif n not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
print("Your password has to contain at least one uppercase letter!")
break
else:
continue
So I am trying to create a program that checks if your password is correct. For some reason "not in" doesn't behave very well. If I write, for example, asd123, it will say that the password has to contain at least one number, which it has. Why is that and how can I fix it?