Question: PYTHON CODING THIS CODE CHECKS IF THE WORD GUESSED BY THE USER IS IN THE PUZZLE def check_word(puzzle, word, row, col, orient): word_upper = word.upper()
PYTHON CODING
THIS CODE CHECKS IF THE WORD GUESSED BY THE USER IS IN THE PUZZLE
def check_word(puzzle, word, row, col, orient): word_upper = word.upper() t = "" if orient == "Horizontal": i = col while i
if orient == "Vertical": i = row while i
IF THIS RETURNS TRUE THEN THE WORD HAS TO BE REPLACED BY HYPHENS IN THE PUZZLE

THIS IS THE PUZZLE WHERE THE WORD ENTERED HAS TO BE CROSSED OUT WITH HYPHENS
PUZZLE=[['S', 'L', 'G', 'R', 'A', 'P', 'E', 'V', 'E', 'X'], ['T', 'W', 'C', 'H', 'E', 'R', 'R', 'Y', 'V', 'S'], ['B', 'L', 'U', 'E', 'B', 'E', 'R', 'R', 'Y', 'H'], ['R', 'J', 'A', 'O', 'R', 'A', 'N', 'G', 'E', 'I'], ['A', 'P', 'P', 'L', 'E', 'E', 'Q', 'Z', 'M', 'A'], ['N', 'O', 'Q', 'L', 'D', 'P', 'E', 'A', 'R', 'O'], ['O', 'B', 'A', 'N', 'A', 'N', 'A', 'O', 'B', 'X'], ['L', 'T', 'T', 'P', 'L', 'U', 'M', 'O', 'Z', 'X'], ['S', 'T', 'R', 'A', 'W', 'B', 'E', 'R', 'R', 'Y'], ['N', 'N', 'L', 'E', 'M', 'O', 'N', 'D', 'P', 'T']]
I JUST NEED THE HYPHENS IN THE PUZZLE PART
Task 6: Update puzzle Write a function named update_puzzle (puzzle, word_size, row, col, orient) that updates the puzzle by crossing the guessed words out. Replace the guessed word by hyphens in the puzzle. Inputs: The puzzle (puzzle), a length of the word (word_size), starting row (row) and column (col) and the orientation (orient). Output: The updated puzzle with the given guessed word replaced by hyphens
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
