I started learning python a week back and I am trying to focus on very basic projects. I am stuck in "The Hangman Game"

> 
> <https://www.codementor.io/@ilyaas97/6-python-projects-for-beginners-yn3va03fs>  
> 
>  Hangman  
> 
>  This is probably the hardest one out of these 6 small
>  projects. This will be similar to guessing the number, except we are
>  guessing the word. The user needs to guess letters, Give the user no
>  more than 6 attempts for guessing wrong letter. This will mean you
>  will have to have a counter.
> 
> 
> 

I have written this code till now:

```
import random

name = input("Please enter your name to play Hangman! ")

print("Welcome "+name+" !. Lets play Hangman.")

wrong_attempt = int(input("How many incorrect attempts do you want ? "))

f = open('words.csv',"r")

secret_word = f.readline()
#print(secret_word)
guesses = ''
while wrong_attempt > 0 :
    c = 0
    letter = input("\nGuess a word : ")
    for char in secret_word :
        if char == letter :
            print(char,end = '')
        else :
            print('*',end = '')
            c += 1
            if c == len(secret_word) :
                wrong_attempt -= 1
                print("Bad Luck. You have ",wrong_attempt," attempts left.")
                print("The secret word is ",secret_word)

if wrong_attempt == 0 :
    print("You LOSE.")

```

The output I am getting right now :

```
Please enter your name to play Hangman! ss Welcome ss !. Lets play Hangman. How many incorrect attempts do you want ? 2

Guess a word : c c******** Guess a word : o
*o******* Guess a word : m
**m****** Guess a word : z
*********Bad Luck. You have  1  attempts left.

Guess a word : d
*********Bad Luck. You have  0  attempts left. You LOSE. The secret word is  computer

```

Expected Output :

```
Please enter your name to play Hangman! ss Welcome ss !. Lets play Hangman. How many incorrect attempts do you want ? 2

Guess a word : c c******** Guess a word : o co******* Guess a word : m com****** Guess a word : z
*********Bad Luck. You have  1  attempts left.

Guess a word : d
*********Bad Luck. You have  0  attempts left. You LOSE. The secret word is  computer

```

Also I am new to stackoverflow when it comes to posting questions. Any suggestions will be appreciated.