ebosetalee / 20-days-challenge

#20dayschallenge on python
6 stars 0 forks source link

6a - Hangman-06 #17

Closed yudori closed 4 years ago

yudori commented 4 years ago

Modify your existing code to use functions.

We can think of the current hangman code as consisting of 3 different parts:

Create the following functions with the following specifications to cover the above three parts of the code respectively.

  1. A function to get the target word: This has no input and returns a string containing the word.
  2. A function to initialize the letters in the dictionary: This takes in no input but returns the dictionary containing the letters in their default False states.
  3. A function to process each turn, where all the guessing logic is carried out: This takes in a string containing the input provided by the user and performs the operations that processes the input. Nothing is returned by the function.

Notes: