Menu

[solved]-Need Add Functions Hangman Game Python Help Python Code Need Add 4 Functions Modules Code Q39019975

I need to add to functions for Hangman Game in python! HELP.

This is the python code but I need to add 4 functions (modules)to the code.

I need the next functions.

—Select word (This function is for select the random word ofthe array)
—check word (This fucntion is for check the word random)
—Verify censored word (This function is for the verify thecensored word, that is, the asterisks must always be there, untilthe correct letter is entered. [********* ]
—Life Manager (This function is to know the player’s remaininglives)

Thanks.!!

import random

import time
word_list =[“Awkward”,”Bagpipes”,”Banjo”,”Bungler”,”Croquet”,”Crypt”,”Dwarves”,”Fervid”,”Fishhook”,”Fjord”,”Gazebo”,”Gypsy”,”Haiku”,”Haphazard”,”Hyphen”,”Ivory”,”Jazzy”,”Jiffy”,”Jinx”,”Jukebox”,”Kayak”,”Kiosk”,”Klutz”,”Memento”,”Mystify”,”Numbskull”,”Ostracize”,”Oxygen”,”Pajama”,”Phlegm”,”Pixel”,”Polka”,”Quad”,”Quip”,”Rhythmic”,”Rogue”,”Sphinx”,”Squawk”,”Swivel”,”Toady”,”Twelfth”,”Unzip”,”Waxy”,”Wildebeest”,”Yacht”,”Zealous”,”Zigzag”,”Zippy”,”Zombie”]
word = random.choice(word_list)
length_word = len(word)
yourword =”
lifes =5

def beginning():
print(“Welcome to Hangnam Game”)
name=input(“What’s your name? “)
print(“Hello “+name, “, Here we go”)
print(“”)
time.sleep(1)
print(“Start to guess”)

beginning()

def change():

print(“The word has”, length_word, “characters”)

change()
  
while lifes > 0:
fault = 0
for letter in word:
if letter in yourword:
print(letter,end=””)
else:
print(“*”,end=””)
fault+=1
if fault == 0:
print(“”)
print(“Congratulations, you are the winner”)
break
  
yourletter = input(“Enter a letter: “)
yourword+=yourletter
  
if yourletter not in word:
lifes -=1
print(“———-You are wrong———-“)
print(“You have “,+lifes,” lifes”)
if lifes ==0:
print(“You lost”)
else:
print(“The word was: “+word)
print(“Thanks for your participation”)

  
  
  

Expert Answer


Answer to I need to add to functions for Hangman Game in python! HELP. This is the python code but I need to add 4 functions (modu… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *