def getNewPuzzle(): global difficulty_setting new_grid = Grid(db_read, difficulty_setting) new_puzzle = new_grid.generate_puzzle() clues = new_grid.clues missing_letters = new_grid.missing_letters #we return three things in the data - a new puzzle, a list of clues for that puzzle, and the missing letters to the answer of that puzzle print missing_letters return json.dumps({'puzzle': new_puzzle, 'clues': clues, 'answers' : missing_letters})