Project

Hangman (Python)

Medium
6560 completions
~ 11 hours
4.4

With functions, loops, lists and other variables, this is a great project for Python basics. As a cherry on top, it even includes a random module. Don’t be intimidated by the number of stages; they ensure that your dive into Python is safe and smooth.

Provided by

JetBrains Academy JetBrains Academy

About

Hangman is a popular yet grim puzzle game. A cruel computer hides a word from you, which you try to guess letter by letter. If you fail, you'll be “hanged”. If you win, you'll survive. You’ve probably played the game at least once or twice. Now you can actually create this game yourself!

Training project icon

Training project

This project allows you to practice and strengthen your coding skills, helping you get ready for more advanced tasks ahead.

What you'll learn

Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
Welcome the user and print “The game will be available soon”.
At this stage, the player will have only one chance to guess the word. Learn how to use “Input” and “if” to implement the most basic version of the game.
Make the game more challenging! Now it will randomly choose one of four words from a list.
Enable hints in your game. Allow it to show the number of letters and the first three letters. Slicing will help you to implement this part.
Using a loop, extend the number of attempts to eight. Now we’re talking!
The outcome of the game may be “fatal”: a feature that makes the game all the more exciting. Work on implementing this feature so that players don’t lose “lives” if they guess the letter correctly. The While loop will help.
Improve the game by handling different error cases. Repetition of a letter, entering words that are too long, or using non-Latin characters shouldn’t cost your player a life.
Dinner at a restaurant starts with the menu; our project ends with one. Create a menu for your game so that players can replay it or exit.

Reviews

Haqu
2 weeks ago
really good project, a bit challenging for the first one that i've picked, but i was satisfied by the outcome.
Carlos Ilich Carro Lozano
2 weeks ago
Great journey and great learning! Maybe it can be emphasized the use of functions to make the code clearer.
Lucie Kazdová avatar
Lucie Kazdová
4 weeks ago
I learned how to work with loops. Working on this project was creative and fun. It wasn't exactly relaxing, but I consider it as very enjoyable project.

4.4

Learners who completed this project within the Python Developer course rated it as follows:
Usefulness
4.5
Fun
4.4
Clarity
4.2