How can I create a basic hangman games in python with 2 player?? Please help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

How can I create a basic hangman games in python with 2 player?? Please help me

How can I create a basic hangman games in python with 2 player?? Please help me

29th Mar 2020, 6:48 PM
Amxl Amixul
Amxl Amixul - avatar
11 Answers
+ 8
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.
29th Mar 2020, 10:08 PM
HonFu
HonFu - avatar
+ 4
I don't understand that question.
29th Mar 2020, 10:41 PM
HonFu
HonFu - avatar
+ 3
Amxl Amixul 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 ...!
30th Mar 2020, 1:23 AM
Crash
Crash - avatar
+ 2
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.
29th Mar 2020, 10:23 PM
HonFu
HonFu - avatar
+ 2
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!
29th Mar 2020, 11:32 PM
HonFu
HonFu - avatar
+ 1
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
31st Mar 2020, 9:58 AM
CutieRei
CutieRei - avatar
0
Thank you for your suggestions I know the basic concepts of it I just what to know if can be created a word guess with 2 player with python and what the suggestion start from
29th Mar 2020, 10:16 PM
Amxl Amixul
Amxl Amixul - avatar
0
Yes I just want to clarify do I must need the list of word in chosen names or can the players 1 type the own to choose for the player 2
29th Mar 2020, 10:38 PM
Amxl Amixul
Amxl Amixul - avatar
0
I said do I must need to put the choose name first
29th Mar 2020, 11:20 PM
Amxl Amixul
Amxl Amixul - avatar
29th Mar 2020, 11:41 PM
Amxl Amixul
Amxl Amixul - avatar
0
See what wrong
29th Mar 2020, 11:41 PM
Amxl Amixul
Amxl Amixul - avatar