Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Sample Words: In this lab assignment, you are going to implement a word guessing game. The program shows a word missing a single character, and
Sample Words:
In this lab assignment, you are going to implement a word guessing game. The program shows a word missing a single character, and player must guess the word. The player can continue guessing the words till all the words in the file are exhausted. Requirements: Create a function called get_a_Word() to read lines from a text file (a sample file will be provided to you) the file is formatted with one word per line the program will select the words one by one from top to the bottom when called, this function will return the next word you will write your code assuming this file is in the same folder as your code and your file is named 'words.txt Create a function called guess_word() that takes the word returned by the get_a_Word) function and returns a guess word randomly select and replace a single character with a placeholder character. For example, the function takes the word 'Classroom' as a parameter, and outputs dl ssroom or_lassroom, etc. use the following function to replace a single character in your string: text- 'Apple text text[1:]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started