Here is the Python 2&#x2F;3 compatible version:<p><pre><code>  license, chosen_word, guesses, scaffold, man, guesses_left = &#x27;https:&#x2F;&#x2F;opensource.org&#x2F;licenses&#x2F;MIT&#x27;, &#x27;&#x27;.join(filter(str.isalpha, __import__(&#x27;random&#x27;).choice(open(&#x27;&#x2F;usr&#x2F;share&#x2F;dict&#x2F;words&#x27;).readlines()).upper())), set(), &#x27;|======\n|   |\n| {3} {0} {5}\n|  {2}{1}{4}\n|  {6} {7}\n|  {8} {9}\n|&#x27;, list(&#x27;OT-\\-&#x2F;&#x2F;\\||&#x27;), 10
  while not all(letter in guesses for letter in chosen_word) and guesses_left: _, guesses_left = list(map(guesses.add, filter(str.isalpha, (__builtins__.raw_input if &#x27;raw_input&#x27; in dir(__builtins__) else __builtins__.input)(&#x27;%s(%s guesses left)\n%s\n%s:&#x27; % (&#x27;,&#x27;.join(sorted(guesses)), guesses_left, scaffold.format(*(man[:10-guesses_left] + [&#x27; &#x27;] * guesses_left)), &#x27; &#x27;.join(letter if letter in guesses else &#x27;_&#x27; for letter in chosen_word))).upper()))), max((10 - len(guesses - set(chosen_word))), 0)
  print(&#x27;You&#x27;, [&#x27;lose!\n&#x27; + scaffold.format(*man), &#x27;win!&#x27;][bool(guesses_left)], &#x27;\nWord was&#x27;, chosen_word)</code></pre>