I see a number of things that may help you improve your code.
Eliminate unused variables
Unused variables are a sign of poor code quality, so eliminating them should be a priority. In this code,
amount_of_letters is set to
0 but never actually used.
Use better function names
main might be find if this were a C program, but there is no requirement or advantage to using the name
main in a Python program. Instead, I'd name it something like
Fix bug #1
At some point, if one is unsuccessful in guessing the word, the program will display the message:
You have 0 chances left.
Guess a letter:
If I have 0 chances left, why am I being asked to guess again?
Fix bug #2
If the word contains multiple copies of the same letter, such as "maxim", if the user guesses
m in that order, they'll see this:
Guess a letter: m
Use a list comprehension
You might not have studied Python long enough to learn about them, but I'd use a list comprehension here. Instead of the
for letter in word loop, I'd write this:
hidden_word = [guess if word[i]==guess else ch for i, ch in enumerate(hidden_word)]
This looks complex, perhaps, but it's actually pretty easy to understand once you've mastered list comprehensions.
Set the case for all letters
At the moment, if the user guesses 'M' but the word is 'nadim', the program will count that as a bad guess. In the traditional hangman game, no distinction is made between capital and lowercase letters. You might consider handling that for your program, such as by forcing all letters to be lowercase for example.
Use variables consistently
guesses variable looks like it's supposed to be the maximum number of guesses allowed, but then we also see a hard-coded
5 in the program at the top of the loop. Choose one (I'd prefer a named constant such as
max_guesses) and stick with it.