I ran it and entered "test" and it said "Password is good". I suspect you meant to have:
password = input("Please enter password: ")
length = False
digit = False
capital = False
length = len(password)
if length > 6:
length = True
#print("Length Good")
for count in password:
if count.isdigit():
digit = True
#print ("Contains digit")
for count in password:
if count.isupper():
capital = True
#print ("Contains a capital")
if length == True and digit == True and capital == True:
print("Password is good")
else:
print("Bad password")
because otherwise you are enforcing bad passwords.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…