Light Mode
Dark Mode
Help! Works in PyCharm and does not in here

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

Attachment
Attachment
Created: Oct. 18, 2020, 9:22 a.m.
Updated: Oct. 18, 2020, 7:29 p.m.
0
10
User avatar
VincentDog