Here:
def isacceptablepassword(a: str) -> bool:
a = a.replace(' ', '')
return a.isalnum() and len(a) >= 6 and not a.isdigit() and not a.isalpha()
Your result:False
Right result:True
Fail:isacceptablepassword("muchlonger5")
PyCharm:
a = 'much longer5' # Also works with 'muchlonger5'
def isacceptablepassword(a):
a = a.replace(' ', '')
return a.isalnum() and len(a) >= 6 and not a.isdigit() and not a.isalpha()
print(isacceptablepassword(a)) # prints True
Created at: Oct. 18, 2020, 9:22 a.m.; Updated at: Oct. 18, 2020, 7:29 p.m.
The question is resolved.