0% found this document useful (0 votes)
3 views

python 1231

The document certifies that three students from Gautam Polytechnic Institute have successfully completed a micro project in Programming with Python for the academic year 2024-2025, focusing on a Hangman game. It includes an introduction to Python, its applications, system requirements, project implementation, results, and a conclusion about the game's educational value. The project aims to enhance programming skills and understanding of logic through a simple yet engaging game.

Uploaded by

itzmerehanop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

python 1231

The document certifies that three students from Gautam Polytechnic Institute have successfully completed a micro project in Programming with Python for the academic year 2024-2025, focusing on a Hangman game. It includes an introduction to Python, its applications, system requirements, project implementation, results, and a conclusion about the game's educational value. The project aims to enhance programming skills and understanding of logic through a simple yet engaging game.

Uploaded by

itzmerehanop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Karmaveer Shankarrao Kale Education Society’s

GAUTAM POLYTECHNIC INSTITUTE GAUTAMNAGAR

CERTIFICATE
This is to certify that
Mr. Sayyed Rehan Amin (2216690061)
Students of third year of Diploma in computer Engineering have completed
the micro project in Programming with python (22616) assigned as per
syllabus satisfactorily for the academic year 2024-2025

Prof.Mapari S.A Prof. Bharti M.B Prof.Bharti.S.M


GUIDE HOD PRINCIPAL
Karmaveer Shankarrao Kale Education Society’s

GAUTAM POLYTECHNIC INSTITUTE GAUTAMNAGAR

CERTIFICATE
This is to certify that
Mr. Gumare Akshay Navnath (2216690060)
Students of third year of Diploma in computer Engineering have completed
the micro project in Programming with python (22616) assigned as per
syllabus satisfactorily for the academic year 2024-2025

Prof.Mapari S.A Prof. Bharti M.B Prof.Bharti S.M


GUIDE HOD PRINCIPAL
Karmaveer Shankarrao Kale Education Society’s

GAUTAM POLYTECHNIC INSTITUTE GAUTAMNAGAR

CERTIFICATE
This is to certify that
Mr. Abhale Atharva Vijay (2216690059)
Students of third year of Diploma in computer Engineering have completed the microproject
in Programming with python (22616) assigned as per syllabus
satisfactorily for the academic year 2024-2025

Prof. Mapari S.A Prof. Bharti M.B Prof.Bharti S.M


GUIDE HOD PRINCIPAL
Karmaveer Shankarrao Kale Education Society’s
GAUTAM POLYTECHNIC INSTITUTE GAUTAMNAGAR

Micro Project Report On


“HANGMAN GAME”

Under the subject of


“ PWP ”

SUBMITTED BY
Mr. Sayyed Rehan Amin
Mr. Ghumre Akshay Navnath
Mr. Abhale Atharva Vijay
Ms. Gade Swarali Girish

UNDER THE GUIDANCE OF


Prof . Mapari S.A

DEPARTMENT OF COMPUTER ENGINEERING


YEAR 2024-2025

Prof. Mapari S.A Prof. Bharti M.B Prof.Bharti.S.M


GUIDE HOD PRINCIPLE
ACKNOWLEDGEMENT

We would like to express our deep sense of gratitude and


special thanks to our guide Prof.Mr.Mapari S.A who not only
took a great interest in the project but also was always ready to
help us as and when needed.
We are also grateful to Prof. M. Bharti M.B(Head of
Computer Department) and all staff members of Computer
Department for their kind co- operation.
Finally we are thankful to all our friends who have helped
for presenting & preparation of our project.
ABSTRACT

This is a simple Hangman game using Python programming


language. We can use this as a small project to boost their programming
skills and understanding logic. The Hangman program randomly selects a
secret word from a list of secret words. The random module will provide
this ability, so line 1 in program imports it. Hangman is a popular word
game in which one player (the "chooser") chooses a secret word and
another player (the "guesser") attempts to guess the word one letter at a
time. If a guessed letter appears in the word, all instances of it are
revealed. If not, the guesser loses a chance. If the guesser figures out the
secret word beforehe or she runs out of chances, he or she wins. If not,
the player who chose.
INDEX

Sr.No Topic Name Page No

1 INTRODUCTION
1.1 Python Programming Language 10
1.2 Application of Python

2 SYSTEM REQUIREMENT
2.1 Software Requirement 13
2.2 Hardware Requirement

3 IMPLEMENTATION OF RESULT
3.1 project code 14
3.2 Result
4 CONCLUSION 20

5 REFRANCES 21
INTRODUCTION

1.1. Python Programming language


Python is one of the many open source object oriented programming
application software available in the market . Python is developed by
Guido van Rossum. Guido van Rossum started implementing Python in
1989. Python is a very simple programming language so even if you
are new to programming, you can learn python without facing any
issues. Some of the many uses of Python are application development,
implementation of automation testing process, allows multiple
programming build, fully constructed programming library, can be
used in all the major operating systems and platforms, database system
accessibility, simple and readable code, easy to apply on complex
software development processes, aids in test driven software
application development approach, machine learning/ data analytics,
helps pattern recognitions, supported in multiple tools, permitted by
many of the provisioned frameworks,etc.
Some features of Python are-
1. Readable: Python is a very readable language.

2. Easy to Learn: Learning python is easy as this is a expressive and


high level programminglanguage, which means it is easy to understand
the language and thus easy to learn.

3. Cross platform: Python is available and can run on various


operating systems such as Mac,Windows, Linux, Unix etc. This makes
it a cross platform and portable language.

4. Open Source: Python is a open source programming language.

5. Large standard library: Python comes with a large standard library that
has some handy codes and functions which we can use while writing code
in Python.

6. Free: Python is free to download and use. This means you can download
it for free and use it inyour application. See: Open Source Python License.
Python is an example of a FLOSS (Free/Libre Open Source Software),
which means you can freely distribute copies of this software, read its
source code and modify it.

7. Supports exception handling: If you are new, you may wonder what is
an exception? An exception is an event that can occur during program
exception and can disrupt the normal flow of program. Python supports
exception handling which means we can write less error prone code and
can test various scenarios that can cause an exception later on.
1.2. Applications of Python programming language

Python can be used to develop different applications like web applications,


graphic user interface based applications, software development application,
scientific and numeric applications, network programming, Games and 3D
applications and other business applications.

1. Web devlopment – Web framework like Django and Flask are based on
Python. They help you write server side code which helps you manage
database, write backend programming logic, mapping urls etc.

2. Machine learning – There are many machine learning applications


written in Python. Machine learning is a way to write a logic so that a
machine can learnand solve a particular problem on its own.
3. Data Analysis – Data analysis and data visualisation in form of charts can
alsobe developed using Python.
4. Scripting – Scripting is writing small programs to automate simple tasks
such as sending automatedresponse emails etc. Such type of applications can
also bewritten in Python programming language.
5. Game development – You can develop games using Python.

6. You can develop Embedded applications in Python.

7. Desktop applications – You can develop desktop application in


Python usinglibrary like TK inter or QT..
2.0 SYSTEM REQUIREMENTS

2.1 Software Requirements


PyCharm2019.1.1(CommunityEdtion)
Build#PC-
191.6605.12,built on April 3, 2019 JRE:11.0.2+9- b159.34amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

2.2 Hardware
Requirement Operating
system:

windows10
Processor: intel corei5
Disk space:1Gb
3.0 IMPLEMENTATION AND RESULTS

3.1 About Project


This is a simple Hangman game using Python programming language. Beginners can
use this as asmall project to boost their programming skills and understanding logic.

1. The Hangman program randomly selects a secret word from a list of secret

words. The randommodule will provide this ability, so line 1 in program


imports it.
2. The Game: Here, a random word (a fruit name) is picked up from our collection

and the playergets limited chances to win the game.


3. When a letter in that word is guessed correctly, that letter position in the word

is made visible. Inthis way, all letters of the word are to be guessed before all
the chances are over.
4. For convenience, we have given length of word + 2 chances. For example, word

to be guessed ismango, then user gets 5 + 2 = 7 chances, as mango is a five letter


word.

3.2 Project code


import datetime

dict = open("dict.txt",
"r+") rec =
open("records.txt", "r+")
board = open("leaderboard.txt", "r+")

words = []
record = []
lead = []

tp = ls = lt = 0

for item in

dict:
words.append(item.strip('\n'))
record=[line.strip() for line in
rec] for item in board:
lead.append(item.strip(' ').split(‘ ‘)

name = input("Welcome to Hangman, enter your name: ")

def choice():
c = input("Enter L for last score, T for total points, B for
Leaderboard, P to play the game, Q to quit:").lower()
choice1(c)

def play():
global tp,
ls global
score
print ("Start guessing,,, All The Best")

fail = 0
ques =
random.choice(words).lower()
guesses = ""
while fail <
7: failed
= 0
for char in ques:
if char in
guesses: print
(char)
else:
print("*")
failed += 1
if failed == 0:
print ("\nYou won, WELL
DONE!") score = score + 10
print ("your score is:",
score) print ("the word was:
", ques) tp = tp + score
print ("your total score is :", tp)
save(score, tp)
guess = input("\nGuess a letter:").lower()
while len(guess) == 0:
guess = input("\nTry again you
muppet:").lower() guess = guess[0]
guesses += guess
if guess not in ques:
fail += 1
print ("\
nWrong") if fail
== 1:
print ("You have", + fail, "fail....WATCH
OUT!") elif fail > 1 and fail < 7:
print ("You have", + fail, "fails....WATCH
OUT!") if fail == 7:
print ("You Lose\n")
print ("your score is, ",
score) print ("the word was,",
ques) score = 0
choice()

def
choice1(c)
: if c ==
"l":
print ("last score is ", ls)
choice()
if c == "t":
print("total points is ",
tp) choice()
if c == "b":
print ("name score \
n") print (lead)
choice()
if c == "p":
play()
if c ==
"q":
print ("Thank You for playing
HangMan") quit()
else:
print ("wrong option try again")
choice()

def choice2():
c = input("enter p to play and q to
quit:").lower() if c == "p":
play()
if c ==
"q":
print ("Thank You for playing
HangMan") quit()
else:
print ("wrong option try again")
choice2()
def save(score, tp):
global ls, record, lead
dt =
datetime.datetime.now()
ary2 = (name, dt, score,
tp) ary1 = (name, tp)
ls = score
record = ary2
lead = ary1
rec.write(name
) rec.write("
")
rec.write(str(dt))
rec.write(" ")
rec.write(str(score))
rec.write(" ")
rec.write(str(tp))
rec.write(" ")
board.write(name)
board.write(" ")
board.write(str(tp))
board.write(" ")
choice()

if name in record:
x =
record.index(name)
lt = record[x+2]
ls =
int(record[x+4]) tp
= int(record[x+6])
del x
choice()
else:
score = 0
ary2 = [name, lt, score, tp]
choice2()
3.3 Results
Snapshots taken from successful runs of the project

Snapshot 3.1:output screen Snapshot

3.2:output screen(true case)


Snapshot 3.3:output screen

Snapshot 3.4:output screen(false case


4.0 CONCLUSION:

In the conclusion of this project, Hangman is a traditional game, typically


played with words. It’s possible, however, to play Category Hangman rather
than guessing words the player might guess names of cities, or athletes, or
fictional characters, or Duke professors, or top forty song titles the list is
endless. You’ll be writing a program to play a “guess a word letter-by-letter”
version of hangman as shown above. You’ll also be doing some statistical
analysis of the words used in the Hangman game.
5.0 REFERENCES:

1. Websites: https://www.youtube.com/watch?
v=QXeEoD0pB3E&list=
PLsyeobzWxl7poL9JTVyndKe6https://www.youtube.com/watch?v

2. https://www.youtube.com/watch?v=BDi3SD7E6no

3. https://en.wikipedia.org/wiki/Hangman_(game)

4. https://www.factmonster.com/games/hangman

You might also like