# PIN problem # Function to return if PIN entered is valid or invalid def GetPIN(PIN): Attempts = 0 ValidInput = False # Validation while not ValidInput and Attempts < 3: Number = input("Enter PIN: ") # Check if PIN matches if Number == PIN: ValidInput = True else: Attempts = Attempts + 1 # Return whether PIN is accepted or not if Attempts < 3: return True else: return False # Main program SecurityPassed = GetPIN("2345") if SecurityPassed: print("Hello") else: print("Locked out")