Skip to content
Merged
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
53 changes: 22 additions & 31 deletions Hangman.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,30 @@
# Creating an empty list
display = []

print(chosen_word)
# Printing out the guess word
print(f"Psst, the guess word is:", chosen_word)

# Print out the Guess Letter
print("Guess a Letter: ", end="")
# For loop for creating the dash sign
for char in chosen_word:
# display += "_"
display.append("_")
# print(display)

# Take input from the user from the Keyboard
guess = input()
while True:

# change the input character from Capital letter to Lowercase letter of the use input
guess = guess.lower()
# Print out the Guess Letter
print("Guess a Letter: ", end="")

count = 0
# Take input from the user from the Keyboard
guess = input()

for char in chosen_word:
# display += "_"
display.append("_")
print(display)

# for num in range(len(chosen_word)):
# # for check in chosen_word:
# count = count + 1
# print(count)
for check in range(len(chosen_word)):
if guess in chosen_word[check]:
display[check] = guess


# for check in chosen_word:
# # print(num)
# if guess in check:
# print(num)
# print("Yes")
# else:
# print("No")

print(display)
# change the input character from Capital letter to Lowercase letter of the use input
guess = guess.lower()

# Making a For loop to count the number of guess and make an index of that number with the missing blanks

for check in range(len(chosen_word)):
if guess in chosen_word[check]:
display[check] = guess

print(display)