week3/crossword/generate.py
def assignment_complete(self, assignment):
        """
        Return True if `assignment` is complete (i.e., assigns a value to each
        crossword variable); return False otherwise.
        """
        # traverse over all variables in the crossword
        for variable in self.crossword.variables:
            # if variable is not in the assignment, meaning it doesn't have a
            # word assigned to it, return False
            if variable not in assignment.keys():
                return False
            # if variable is in the assignment and the word assigned to it
            # is not among words that are still available, return False
            if assignment[variable] not in self.crossword.words:
                return False
        # Otherwise everything is nice, return True
        return True

        Return True if `assignment` is complete (i.e., assigns a value to each
        crossword variable); return False otherwise.
        
Return True if `assignment` is complete ; return False otherwise.
Return True if ` assignment ` is complete ; return False otherwise .
def assignment_complete(self, assignment):
        for variable in self.crossword.variables:
            if variable not in assignment.keys():
                return False
            if assignment[variable] not in self.crossword.words:
                return False
        return True
def assignment_complete ( self , assignment ) : for variable in self . crossword . variables : if variable not in assignment . keys ( ) : return False if assignment [ variable ] not in self . crossword . words : return False return True
Return True if `assignment` is complete (i.e., assigns a value to each
crossword variable); return False otherwise.
Return True if ` assignment ` is complete ( i . e . assigns a value to each crossword variable ) ; return False otherwise .
"""
        Return True if `assignment` is complete (i.e., assigns a value to each
        crossword variable); return False otherwise.
        """ # traverse over all variables in the crossword # if variable is not in the assignment, meaning it doesn't have a # word assigned to it, return False # if variable is in the assignment and the word assigned to it # is not among words that are still available, return False # Otherwise everything is nice, return True
self
assignment