input: Write a function to play a simple hangman game.
  assert hangman_game(["apple", "banana", "grape"], "apple", ["a", "p", "l", "e"]) == "You Win!"
  assert hangman_game(["apple", "banana", "grape"], "grape", ["g", "r", "a", "p"]) == "You Lose! The word was grape."
  assert hangman_game(["apple", "banana", "grape"], "banana", ["b", "a", "n"]) == "You Lose! The word was banana."
output: def hangman_game(word_list, chosen_word, guesses):
      if chosen_word not in word_list:
          return "Invalid word"
      
      guessed_word = ''.join([letter if letter in guesses else '_' for letter in chosen_word])
      
      if guessed_word == chosen_word:
          return "You Win!"
      else:
          return f"You Lose! The word was {chosen_word}."