Professional Documents
Culture Documents
Python Programme Final
Python Programme Final
SUBMITTED TO : SUBMITTED BY :
Teacher’s Signature
2 of 19
CERTIFICATE
This is to certify that Ms./Mr. Sai Pranith.S, Roll No. 2474 of class XI
(Session 2022-23), Suguna Pip School has completed the project based
on the topic “HANGMAN” as a part of the paper of Computer
Science (083).
It is a bona- de piece of work done under my supervision and
guidance to the best of my knowledge. It is the original work of the
candidate and is a result of her/his effort in partial ful lment of
requirement as per AISSCE curriculum of class XI.
EXTERNAL
REGISTRATION NO : 2474
CLASS : 11 AN2
DATE OF SUBMISSION :
4 of 19
INTRODUCTION
Hangman is a 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
letters within a certain number of guesses. Originally a Paper- and-pencil
game, there are now electronic versions.
Though the origins of the game are unknown, a variant is mentioned in a
book of children's games assembled by Alice Gimme in 1894 called Birds,
Beasts, and Fishes.This version lacks the image of a hanged man, instead
relying on keeping score as to the number of attempts it took each player to
ll in the blanks.
A version which incorporated hanging imagery was described in a 1902
Philadelphia Inquirer article, which stated that it was popular at "White
Cap" parties hosted by "Vigilance Committees" where guests would wear
"white peaked caps with masks".
The word to guess is represented by a row of dashes representing each
letter of the word. Rules may permit or forbid proper nouns, such as
names, places, brands, or slang. If the guessing player suggests a letter
which occurs in the word, the other player writes it in all its correct
positions. If the suggested letter does not occur in the word, the other
player removes (or alternatively, adds) one element of a hanged stick gure
as a tally mark. The player guessing the word may, at any time, attempt to
guess the whole word.[3] If the word is correct, the game is over and the
guesser wins. Otherwise, the other player may choose to penalise the
guesser by adding an element to the diagram. On the other hand, if the
guesser makes enough incorrect guesses to allow the other player to
complete the diagram, the guesser loses. However, the guesser can also win
by guessing all the letters that appear in the word, thereby completing the
word, before the diagram is completed.
5 of 19
fi
fi
OBJECTIVE
6 of 19
SCOPE
7 of 19
fi
HARDWARE AND SOFTWARE
REQUIREMENTS:
• Python 3.11.1
• Anaconda navigator
8 of 19
DESCRIPTION
9 of 19
fi
fl
fi
fi
FUTURE SCOPE:
10 of 19
fi
fi
fi
fi
fi
DRAWBACKS
11 of 19
SOURCE CODE :
import random
import time
def play_loop():
global play_game
play_game = input("Do You want to play again? y = yes, n = no \n")
while play_game not in ["y", "n","Y","N"]:
play_game = input("Do You want to play again? y = yes, n = no \n")
if play_game == "y":
main()
elif play_game == "n":
12 of 19
fi
fi
print("Thanks For Playing! We expect you back again!")
exit()
else:
count += 1
if count == 1:
time.sleep(1)
print(" _____ \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")
elif count == 2:
13 of 19
fi
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")
elif count == 3:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")
elif count == 4:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " last guess remaining\n")
elif count == 5:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | /|\ \n"
" | / \ \n"
"__|__\n")
14 of 19
print("Wrong guess. You are hanged!!!\n")
print("The word was:",already_guessed,word)
play_loop()
main()
hangman()
15 of 19
OUTPUT:
16 of 19
17 of 19
CONCLUSION :
18 of 19
fi
BIBLIOGRAPHY
• Sumita Arora
• www.wikipedia.com
• www.python.com
• jurnal.untan.ac.id
• pcgamebenchmark.com
• www.programiz.com
19 of 19