• Help! Works in PyCharm and does not in here

Question related to mission Acceptable Password II

 

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