Password check- Python 3
问题 Write a function that checks whether a string is valid password. Rules: Must have at least 8 characters A password must consist of only letters and digits A password must contain at least 2 digits Heres what I have so far, what am i doing wrong? thank you def getPassword(): password = input("Enter password: ") return password def validPassword(password): if len(password) >= 8: valid = True if password.alnum(): valid = True if password.isdigit < 2: valid = True else: return False def main():