Have you studied the basics of the language? (You seem to have not read the tutorial here.) That comes first.
Then how are we supposed to help you? If we tell you exactly how to do it, it is us who will have written the game.
You should give it an honest try to figure it out yourself.
If you get stuck, show us what you've got, someone might give you a hint.
It looks like you have no programming experience at all.
Work your way through the Python course.
You can't program a Hangman game if you don't even know the most basic basics.
Even the print statements in your code are incorrect ...!
Well, you need a list of words, where one is picked randomly from.
You need a list of letters already chosen. Only if a letter of the word is in 'chosen', it will be printed, otherwise '_' (can be done with if else).
You take user input in a loop and put it into chosen. If it's in word, great, if not - player loses one 'life'. (How you output the hangman is up to you, you could also just have a counter, so and so many moves.)
If all letters found, won.
If not moves left, game over.
Something like this.
There are several ways to set this up, depending on how you'd like it.
Could be a solitaire game, with or without player name.
Could be for several players, either fixed upper limit or unlimited (probably nonsense), with or without names.
I think you should have some idea now though how this might play out. Now it's time for your own creativity.
Think a bit about how you want to have it, then give it a shot! 😉
And when you're finished (or get into trouble), please show us!
very very broken undeclared variable and i guess the code is not complete if you doesnt want to see the player 1 guess just do this:
import os #put in the top
and then after the player 1 guess add this:
os.system('clear') #this cleared the console doesnt work for sololearn tho