MCPcopy Create free account
hub / github.com/geekcomputers/Python / get_word

Method get_word

Industrial_developed_hangman/src/hangman/main.py:107–119  ·  view source on GitHub ↗

Parse word(wrapper for local and web parse). :returns str: string that contains the word. :raises AttributeError: Not existing enum

(self)

Source from the content-addressed store, hash-verified

105 self._choice_function = ch_func
106
107 def get_word(self) -> str:
108 # noqa: DAR201
109 """
110 Parse word(wrapper for local and web parse).
111
112 :returns str: string that contains the word.
113 :raises AttributeError: Not existing enum
114 """
115 if self._source == Source.FROM_INTERNET:
116 return parse_word_from_site()
117 elif self._source == Source.FROM_FILE:
118 return parse_word_from_local(self._choice_function)
119 raise AttributeError("Non existing enum")
120
121 def user_lose(self) -> None:
122 """Print text for end of game and exits."""

Callers 2

start_gameMethod · 0.95
test_get_wordFunction · 0.95

Calls 2

parse_word_from_siteFunction · 0.85
parse_word_from_localFunction · 0.85

Tested by 1

test_get_wordFunction · 0.76