Code for hangman game in python