Sfoglia il codice sorgente

pendu.py: cosmetic changes

master
Dimitri Merejkowsky 6 anni fa
parent
commit
98dc0984cf
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. +5
    -1
      sources/04-pendu.py

+ 5
- 1
sources/04-pendu.py Vedi File

@@ -3,6 +3,7 @@ import random
def read_words():
stream = open("noms.txt")
words = stream.read().splitlines()
stream.close()
return words


@@ -13,7 +14,10 @@ def choose_word(words):


def has_won(word, letters):
return set(word) == letters
for letter in word:
if letter not in letters:
return False
return True


def display_hint(word, letters):