Posts

Showing posts with the label hangman using python

HangMan game in PYTHON

Image
  What is hangman? Libraries Hangman  is a paper and pencil guessing game  for two or more players. One player thinks of a word, phrase or sentence  and the other(s) tries to guess it by suggesting  l etters  within a certain number of guesses.  wikipedia Code: import random as r listOfWords1 = ["pace", "space", "cross", "edge", "nine", "tame", "spawn", "real", "world", "seed"] listOfWords2 = ["computer", "physics", "science", "sapiens", "building"] def main():     guesses = ""     level = input("Easy(e)/Medium(m)/Hard(h):\n").lower()     print("----------")     if level == "e":         turns = 5         word = r.choice(listOfWords1)     elif level == "m":         turns = 3         word = r.choice(listOfWords1)     elif level == "h":         turns = 3         word =...