我正在爲學校製作一個密碼項目,我陷入了一個問題。這裏是心不是正常的代碼:密碼python項目編號
def passwordStrength(password):
if password.islower():
print("Your password is weak as it only contains lower case letters")
elif password.isupper():
print("Your password is weak as it only contains capital letters")
elif password.isnumeric():
print("Your password is weak as it only contains numbers")
elif password.islower and password.isupper:
print("Your password is medium as it contains no numbers")
elif password.islower and password.isnumeric:
print("Your password is medium as it contains no uppercases")
elif password.isupper and password.isnumeric:
print("Your password is medium as it contains no lowercases")
elif password.islower and password.isupper and password.isnumeric:
print("Your password is strong")
,但如果我的密碼,如「asasASAS1212」鍵入它說,它不包含數字
'islower'是一個函數,而不是一個屬性(等)。 – Sayse
你不叫'islower'和其他人 –
此外,你的同學建議的重複[question](http://stackoverflow.com/q/41117733/1324033)可能會進一步幫助 – Sayse