Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Have students write a game of Hangman in Python in which the computer cheats by changing its secret word to give students practice using dictionaries.

Share Have students write a game of Hangman in Python in which the computer cheats by changing its secret word to give students practice using dictionaries. with FacebookShare Have students write a game of Hangman in Python in which the computer cheats by changing its secret word to give students practice using dictionaries. with Twitter
  • Each time the user guesses a letter, the computer checks a dictionary to see if there is another word consistent with previous guesses that does not contain the new letter.
    • If so, the computer will change its secret word to this new word, cheating.
  • See the Duke version of this assignment for inspiration on implementing this assignment in your classroom.

More about this tip

Tags

  • Meaningful and Relevant Content
  • Python
External Source
Duke Clever Hangman assignment by Owen Astrachan.
Other Tips By
Other Tips By Owen Astrachan

Similar tips

Use popular, repetitive music to teach loops in a beginning course because this motivates the purpose and application of loops while keeping students engaged by referencing popular culture.
Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes.
Have students program a robot to play a song to engage novices.

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Powered by Drupal.

Privacy Policy