100% found this document useful (1 vote)
3K views16 pages

Hangman Game Mini Project Report

This document appears to be a mini project report for a Hangman game developed using Python programming language. It was created by three students - Bhavana K S, Pruthvi Raj B, and Sushmitha C - under the guidance of a professor. The report includes an introduction to Python programming and the game of Hangman, system requirements, implementation details including the program code and results, and conclusions. It follows a typical report structure of introduction, requirements, implementation, and conclusion sections.

Uploaded by

MR VIJAY
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
100% found this document useful (1 vote)
3K views16 pages

Hangman Game Mini Project Report

This document appears to be a mini project report for a Hangman game developed using Python programming language. It was created by three students - Bhavana K S, Pruthvi Raj B, and Sushmitha C - under the guidance of a professor. The report includes an introduction to Python programming and the game of Hangman, system requirements, implementation details including the program code and results, and conclusions. It follows a typical report structure of introduction, requirements, implementation, and conclusion sections.

Uploaded by

MR VIJAY
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
  • Abstract
  • Introduction
  • Organization of the Report
  • System Requirements
  • Implementation and Results
  • Conclusion
  • References

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belagavi – 590018, Karnataka

Python Application Programming


A mini project report on

HANGMAN GAME

Submitted By:

BHAVANA K S (1GA17CS031)
PRUTHVI RAJ (1GA17CS112)
SUSHMITHA C (1GA17CS161)

Under the Guidance of


Dr. Kavitha K S
Professor

Department of Computer Science and Engineering


(Accredited by NBA 2019-2022)
Global Academy of Technology
Rajarajeshwari nagar, Bangalore – 560098
2019-2020
Global Academy of Technology
Department of Computer Science and Engineering

Certificate
This is to certify that the project entitled ”HANGMAN GAME” is a bonafide work
carried out by Bhavana K S(1GA17CS031),Pruthvi Raj B(1GA17CS122), Sushmitha
C(1GA17CS161), as a part of assignment in Python Applications Programming in
Computer Science and Engineering during the year 2019-2020.

Faculty Name and


Max. marks Marks obtained
Signature

07
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 before
he or she runs out of chances, he or she wins. If not, the player who chose the word wins.
TABLE OF CONTENTS

TOPIC PAGE NO

1. INTRODUCTION

1.1 Python Programming Language 2

1.2 Applications of Python 4

2. SYSTEM REQUIREMENTS

2.1 Software Requirements 5

2.2 Hardware Requirements 5

3. IMPLEMENTATION AND RESULTS

3.1 Project Code 6

3.2. Results 10

CONCLUSION 12

REFERENCES 12
Hangman Game

ORGANIZATION OF THE REPORT

The report is divided into various chapters and is organized as follows:

Chapter 1: Introduction
This chapter includes brief introduction to Python Programming Language and its applications.

Chapter 2: System requirements


This chapter includes details of hardware and software requirements necessary for the
execution of the project.

Chapter 3: Implementation and Results


This chapter includes the program code of the project and the results of successful runs of the
code.

Conclusion
This section includes the conclusion about the project.

References
This section includes the bibliographical references used for the development of the project.

Dept. of CSE, GAT Page 1 2019-2020


CHAPTER 1

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 programming
language, 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 in
your 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.

8. Advanced features: Supports generators and list comprehensions. We will cover these features
later.

9. Automatic memory management: Python supports automatic memory management which means
the memory is cleared and freed automatically
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. It makes an interactive
interface and easy development of [Link] may be wondering what all are the applications of
Python. There are so many applications of Python, here are some of the them.

1. Web development – 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 learn and solve a particular problem on its
own. For example, products recommendation in websites like Amazon, Flipkart, eBay etc. is a
machine learning algorithm that recognises user’s interest. Face recognition and Voice recognition in
your phone is another example of machine learning.

3. Data Analysis – Data analysis and data visualisation in form of charts can also be developed using
Python.

4. Scripting – Scripting is writing small programs to automate simple tasks such as sending automated
response emails etc. Such type of applications can also be written 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 using library like TKinter or
QT.
CHAPTER 2

SYSTEM REQUIREMENTS

2.1 Software Requirements


PyCharm2019.1.1(CommunityEdition)
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 Requirements
Operating system: windows 10
Processor: intel core i5
Disk space:1Gb
CHAPTER
3
IMPLEMENTATION AND RESULTS

3.1 About Project


This is a simple Hangman game using Python programming language. Beginners can use this as a
small 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 random
module 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 player
gets 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. In
this 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 is
mango, then user gets 5 + 2 = 7 chances, as mango is a five letter word.

3.2 Project code


import random
import datetime

dict = open("[Link]", "r+")


rec = open("[Link]", "r+")
board = open("[Link]", "r+")

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

tp = ls = lt = 0

for item in dict:


[Link]([Link]('\n'))
record=[[Link]() for line in rec]
for item in board:
[Link]([Link](' ').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 = [Link](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 = [Link]()
ary2 = (name, dt, score, tp)
ary1 = (name, tp)
ls = score
record = ary2
lead = ary1
[Link](name)
[Link](" ")
[Link](str(dt))
[Link](" ")
[Link](str(score))
[Link](" ")
[Link](str(tp))
[Link](" ")
[Link](name)
[Link](" ")
[Link](str(tp))
[Link](" ")
choice()

if name in record:
x = [Link](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)


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.

REFERENCES

Bibliography:
[1] “Python for everybody”, Charles [Link]
[2] “Think Python”, Allen [Link]
[3]”Python programming”, Mark lutz

Websites:
[1][Link]
2ieoN-MZ3
[2][Link]
[3] [Link]

Common questions

Powered by AI

Python's exception handling feature allows developers to anticipate potential errors and define how the program should behave in such instances. This proactive management helps in writing less error-prone code by enabling the creation of handlers for specific exceptions, ensuring that the program continues to run smoothly despite encountering unexpected issues. This is supported by a robust set of built-in exceptions and the ability to create custom ones, enhancing the overall reliability and maintainability of the code .

Developing a Hangman game provides educational value by reinforcing fundamental programming concepts such as control flow with loops and conditionals, data manipulation through strings and lists, and basic I/O operations for file handling. It emphasizes algorithmic thinking through logical structures of guessing and verification processes and introduces modular programming by encouraging the breakup of tasks into functions, thereby enhancing both problem-solving skills and understanding of program architecture .

Python facilitates automation in software testing and development through its simplicity and readability, making it easy to write scripts for various automated tasks. It supports frameworks like unittest and pytest for test automation, and its integration with continuous integration tools allows seamless test execution. Python’s dynamic nature and extensive libraries further enhance its capability to automate repetitive tasks, increasing efficiency in both development and deployment processes .

To enhance user interaction and gameplay experience in the Hangman project, improvements could include incorporating graphical user interface elements using libraries like Tkinter for more engaging visuals, adding sound effects for guess outcomes, and implementing different difficulty levels by varying word lengths or allowed guesses. Moreover, integrating a database for persistent score tracking and a dynamic leader board could provide an enriched competitive aspect .

Python plays a crucial role in advancing machine learning applications by offering powerful libraries such as TensorFlow, Keras, and scikit-learn, which simplify complex algorithms into manageable code. Its straightforward syntax enables quick prototyping and testing of machine learning models. Python's integration capabilities with C/C++ and Java facilitate enhanced computational performance, essential for training large models, while comprehensive visualization libraries like Matplotlib and Seaborn offer insightful data presentations, essential for interpreting machine learning outputs and improving algorithms .

Python’s status as Free/Libre Open Source Software (FLOSS) significantly contributes to its widespread adoption across industries. FLOSS allows organizations to use, copy, modify, and distribute Python without licensing fees, lowering the barrier to entry for many companies. It encourages community contributions, leading to rapid development of features and bug fixes, and facilitates transparency and auditability in security-focused industries. This open collaboration model enhances innovation and application diversity, assuring Python’s adaptability to evolving technological needs .

Python's design features such as its interpreter-based execution model, extensive standard library, and compatibility with various underlying operating systems (e.g., Windows, macOS, Linux) make it inherently cross-platform. This flexibility allows developers to write code once and deploy it across multiple environments without modification, significantly reducing development time and easing maintenance across different platforms .

The Hangman project utilizes Python’s `random` module to select a secret word randomly, showcasing the use of libraries in implementing core game functionality. The project also employs file operations to handle records, demonstrating the application of Python’s built-in functionality for reading and writing text files to maintain game state and player scores .

The Hangman project utilizes Python's `datetime` module to record the timestamp of each game's completion, important for tracking player scores and progression over time. This timestamp can be used for defining session durations, comparing performances across different sessions, or maintaining a time-bound leaderboard. Accurate timekeeping is crucial for implementing features like timing constraints and ensures consistent, reliable record management .

Python's support for list comprehensions and generators offers efficient memory use and streamlined syntax for iteration, making it particularly effective in data-heavy applications. List comprehensions provide a concise way to create and transform lists without explicit loops, while generators offer benefits of high memory efficiency by lazily evaluating elements on demand rather than holding an entire list in memory. This leads to optimized performance for operations like data processing and transformation, especially with large datasets .

VISVESVARAYA TECHNOLOGICAL UNIVERSITY
Jnana Sangama, Belagavi – 590018, Karnataka
Python Application Programming
A mini proje
Global Academy of Technology
Department of Computer Science and Engineering
Certificate
This is to certify that the project e
ABSTRACT
This is a simple Hangman game using Python programming language. We can use this as a
small project to boost their p
TABLE OF CONTENTS
TOPIC
PAGE NO
1. INTRODUCTION
1.1 Python Programming Language
2
1.2 Applications of Python
4
2. SYSTEM REQU
Hangman Game
Dept. of CSE, GAT
Page 1
2019-2020
ORGANIZATION OF THE REPORT
The report is divided into various chapters and is
CHAPTER 1
INTRODUCTION
1.1.
Python Programming language
Python is one of the many open source object oriented programming app
1. Readable: Python is a very readable language.
2. Easy to Learn:  Learning python is easy as this is a expressive and high
1.2.
Applications of Python programming language
Python can be used to develop different applications like web applications,
CHAPTER 2
SYSTEM REQUIREMENTS
2.1 Software Requirements 
PyCharm2019.1.1(CommunityEdition) 
Build#PC-191.6605.12,built on Apr
CHAPTER 
3
IMPLEMENTATION AND RESULTS
3.1 About Project
This is a simple Hangman game using Python programming language. Begi

You might also like