0

normal code?)

import random s = "" some_word = ['яблоко','банан','свекла','огурец','киви','гречка'] word = random.choice(some_word) print(word) print("Подсказка: угадай, слово это фуркт, овощь, или ягода.Удачи") chances = len(word) + 2 latters_gussed = [" _ "] * len(word) for letters in latters_gussed: print(letters, end=' ') print() while latters_gussed != list(word) and chances > 0 : guess = input("Введите букву: ") chances = chances - 1 if guess in word: print("Молодец! буква угадана!") for index, latter in enumerate(word): if s == guess: latters_gussed[index] = s for letters in latters_gussed: print(letters, end=' ') else: print("буква не угадана, попробуй ещё, чувак") print('\n осталось:', chances, 'попыток брат')

11th Dec 2022, 8:26 AM
Павел Соколов
Павел Соколов - avatar
1 Answer