Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated hangman game #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions hangman_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Initial Steps to invite in the game:
print("\nWelcome to the Hangman game\n")
name = input("Enter your name: ")
print("Hello " + name + "! Best of Luck!")
print("Hello there," + name + "! Best of Luck!")
time.sleep(1)
print("The game is about to start!\n Let's play Hangman!")
print("The game is about to start!\nLet's play Hangman!!")
time.sleep(1)


Expand Down Expand Up @@ -51,7 +51,7 @@ def hangman():
guess = input("This is the Hangman Word: " + display + " Enter your guess: \n")
guess = guess.strip()
if len(guess.strip()) == 0 or len(guess.strip()) >= 2 or guess <= "9":
print("Invalid Input, Try a letter\n")
print("Invalid Input, Try again using a letter\n")
hangman()


Expand Down Expand Up @@ -132,3 +132,13 @@ def hangman():

if word == '_' * length:
print("Congrats! You have guessed the word correctly!")
play_loop()

elif count != limit:
hangman()


main()


hangman()