python mpkk
python mpkk
AND
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
Date:
PRINCIPAL
ACKNOWLEDGEMENT
We would like to express our thanks to the people who have helped us most throughout
our project. We would like to express our sincere thanks to the principal of CSMSS
College of Polytechnic Dr. G. B. Dongre for being always with us as a motivator. We
are thankful to the H.O.D of Computer Engineering Department Ms. R. S. Pophale
for her kind support. We are grateful to our Project Guide Ms. N. S . Wagh for nonstop
support and continuous motivation for the project Her help made uspossible to complete
our project with all accurate information. A special thanks of our goes to our friends
who helped us in completing the project, where they all exchanged their own interesting
ideas. We wish to thanks our parents for their personal support or attention who inspired
us to go our own way. Finally, we would like to thank God who made all things possible
for us till the end.
2. RATIONALE ....................................................................................................... 3
6. PROGRAM CODE……………………………………………………………10-13
7. OUTPUT…………………………………………………………………………14-15
8. CONCLUSION………………………………………………………………….16
11. REFERENCE…………………………………………………………………18
1. MICRO – PROJECT PROPOSAL
7 Final submission of
08/04/2024 11/04/2024 All
Micro-Project.
1
❖ NAMES OF TEAM MEMBER WITH ROLL NO:
Approved by
Ms. N. S. WAGH
2
2. RATIONALE
Python is powerful programming language. It has efficient high-level data structures and a simple but
effective approach to object-oriented programming. Python code is simple, short readable, intuitive, and
powerful, and thus it is effective for introducing computing and problem solving to beginners. It's elegant
syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting
and rapid application development in many areas on most platforms.
3
3. AIMS / BENEFITS OF THE MICROPROJECT
❖ Benefits of project:
➢ Programming Skills Development: Developing a word guessing game in Python can help improve
your programming skills, especially if you're a beginner. You'll get hands-on experience with
concepts such as loops, conditionals, functions, string manipulation, and data structures like lists and
dictionaries.
➢ Problem-Solving Skills: Designing the game involves breaking down the problem into smaller,
manageable parts and figuring out how to implement each part effectively. This helps enhance your
problem-solving skills, a crucial ability in programming
4
4. COURES OUTCOME ACHIVED
5
5. LITERATURE REVIEW
• Word Guessing Game using python
In this tutorial, we'll use the "random module" to play an interactive game of word guessing. This game
is intended for those who are just beginning to learn to code in Python and will give them an overview
of strings, loops, and conditional (If, otherwise) statements.
• Random Module:
Sometimes, we need the computer to choose the random number from the specified range, choose an
element randomly from a set, choose the random card from an assortment of decks, flip a coin, and so
on. The random module allows the ability to access functions that can support these kinds of operations.
One of these operations is the random.choice() technique (returns an unspecified item from a tuple, list,
or string.) which we'll make use of to choose the random words from a set of terms we've generated. The
game involves an array of words from which our interpreter will select one random word. The player
must first input their names and is challenged to guess the alphabet of their choice after that. If the random
word is comprised of the alphabet, it will be displayed in the output (with proper placement); otherwise,
the program will prompt you to choose an alternative alphabet. Users will be given 12 turns (can be
modified according to) to determine the full word. Below is an example of the Python implementation
A word guessing game typically involves a player attempting to guess a hidden word, letter by letter,
within a certain number of attempts. The game usually proceeds as follows:
Initialization: The game starts by selecting a word from a predefined list or generating a random word.
This word is kept hidden from the player.
Displaying Information: The player is informed about the length of the word (e.g., "_ _ _ _ _ _") and
the number of attempts they have.
6
Guessing: The player guesses letters one by one, attempting to uncover the hidden word. After each
guess, the game provides feedback on whether the guessed letter is present in the word and its position(s).
Feedback: Depending on the correctness of the guess, the game informs the player if the guessed letter
is correct or incorrect and updates the display accordingly.
Win/Lose Conditions: The game continues until the player either guesses the entire word correctly or
runs out of attempts. If the player guesses the word within the allowed attempts, they win; otherwise,
they lose.
Option to Play Again: After the game ends, the player may be given the option to play again, restarting
the process with a new word.
Players can enjoy this game individually or in multiplayer mode, where they take turns guessing the word
within a set time limit Developing this game involves implementing various programming concepts,
including string manipulation, conditional statements, loops, and user input handling. It offers an
opportunity to practice problem-solving skills, algorithm design, and software development best practices
The game can be customized in numerous ways, such as adjusting the difficulty level by changing the
word length or the number of allowed attempts, adding hints or clues, incorporating a scoring system, or
introducing thematic variations (e.g., categories of words). Overall, it's a versatile and enjoyable project
for both learners and developer
A word guessing game, also known as "Hangman," is a classic word game where one player thinks of a
word and the other player tries to guess it by suggesting letters within a certain number of attempts. Let's
break down the components and mechanics of a word guessing game in detail:
Components: Word Selection: The game begins with one player (the "chooser") selecting a word. This
word is typically kept hidden from the other player (the "guesser").
Display: Initially, the guesser sees a representation of the word with blanks for each letter, indicating its
length. For example, if the chosen word is "PYTHON," the display might initially show "_ _ _ _ _ _".
Attempts Counter: The guesser is given a limited number of attempts to guess the word. This counter
decreases with each incorrect guess.
7
Alphabet Display: The guesser typically sees a display of the alphabet or a set of buttons representing
each letter that they can choose from to make their guess.
Feedback: After each guess, the guesser receives feedback on whether the guessed letter is present in the
word and its position(s) if it is.
Win/Lose Conditions: The game ends when the guesser either correctly guesses the word or exhausts
all their attempts without guessing correctly.
If the guessed letter is correct, the game updates the display to reveal the letter's position(s) in the word.
If the guessed letter is incorrect, the game decreases the remaining attempts counter.
Feedback: If the guessed letter is correct, the game provides feedback indicating its position(s) in the
word (e.g., "The letter 'A' is in the word at positions 2 and 4").
If the guessed letter is incorrect, the game informs the guesser and may display a visual representation of
a hangman being drawn (representing the number of incorrect guesses).
Win/Lose Conditions: If the guesser correctly guesses all the letters in the word before running out of
attempts, they win the game. If the guesser exhausts all their attempts without correctly guessing the
word, they lose the game.
Game Loop: The game continues until the guesser wins or loses. After the game ends, the chooser may
reveal the word to the guesser, and they may choose to play again with a new word.
Additional Features:
Difficulty Levels: The game may offer multiple difficulty levels, such as easy (fewer letters, more
attempts) or hard (longer words, fewer attempts).
Visual Elements: Adding visual elements like a hangman figure being drawn progressively with each
incorrect guess can enhance the game's appeal.
8
Word Categories: The chooser may select words from specific categories (e.g., animals, countries,
movies) to add variety to the game.
Scorekeeping: Implementing a scoring system based on the number of attempts taken or the difficulty
level can add a competitive element to the game.
Hint System: Incorporating a hint system where the guesser can ask for a clue about the word (e.g., its
category or a letter in the word) can make the game more accessible.
Multiplayer Mode: Allowing multiple players to take turns as the chooser and guesser adds a social
element to the game.
Implementation:
Developing a word guessing game involves programming concepts such as string manipulation,
conditional statements, loops, user input handling, and possibly graphical user interface (GUI)
development if you want to create a more interactive experience. You can implement the game in various
programming languages, but Python is commonly used due to its simplicity and versatility.
• Educational Benefits:
1) Language Learning: Word guessing games can help players expand their vocabulary as they
encounter new words during gameplay. They learn to recognize and spell words correctly.
2) Spelling Practice: By guessing letters to form words, players practice spelling and reinforce their
understanding of word structures.
3) Reading Comprehension: Players improve their reading comprehension skills by deciphering
clues or hints provided during the game.
4) Critical Thinking: Players must think critically to deduce possible words based on the clues
provided, such as word length or theme.
5) Strategy Development: As players make educated guesses based on patterns and available letters,
they develop strategic thinking skills.
9
• Cognitive Benefits:
1) Memory Enhancement: Remembering previously guessed letters and their positions helps
improve memory retention.
2) Problem-Solving Skills: Players engage in problem-solving as they strategize to deduce the
hidden word within the given constraints.
3) Pattern Recognition: Recognizing patterns in the guessed letters and word structures aids in
deciphering the hidden word efficiently.
4) Attention to Detail: Players pay close attention to the feedback provided after each guess,
fostering attention to detail.
5) Persistence and Resilience: Trying multiple guesses despite initial failures encourages persistence
and resilience in players.
1) Collaboration and Cooperation: Word guessing games can be played collaboratively, fostering
teamwork and cooperation among players.
2) Friendly Competition: Competitive elements, such as scorekeeping or time limits, add excitement
and friendly competition to the gameplay.
3) Sense of Accomplishment: Successfully guessing the word or making progress in the game boosts
players' self-esteem and sense of accomplishment.
4) Stress Reduction: Engaging in a fun and mentally stimulating activity like a word guessing game
can help reduce stress and promote relaxation.
5) Social Interaction: Playing word guessing games with others encourages social interaction,
whether in person or online, promoting communication skills and social connections.
10
7.Program code
import random
import tkinter as tk
def choose_word():
words_and_hints = {
"apple": "A common fruit",
"banana": "Yellow and long fruit",
"orange": "A citrus fruit",
"grape": "A small round fruit often found in bunches",
"kiwi": "A small, brown, and fuzzy fruit",
"pineapple": "A tropical fruit with a spiky exterior",
"strawberry": "A small, red fruit with seeds on the outside",
"blueberry": "A small, round, and blue fruit often used in muffins",
"watermelon": "A large fruit with green skin and red flesh"
}
word, hint = random.choice(list(words_and_hints.items()))
return word, hint
def update_display():
display_text.set(display_word(word, guessed_letters))
hint_label.config(text="Hint: " + hint)
def check_guess():
global attempts
11
guess = guess_entry.get().lower()
if guess in guessed_letters:
feedback_label.config(text="You already guessed that letter.")
elif guess in word:
guessed_letters.append(guess)
feedback_label.config(text="Correct!")
else:
global attempts
attempts -= 1
attempts_label.config(text="Attempts left: {}".format(attempts))
feedback_label.config(text="Incorrect.")
update_display()
def main():
global word, hint, guessed_letters, attempts
word, hint = choose_word()
guessed_letters = []
attempts = 6
12
hint_label = tk.Label(window, text="Hint: " + hint)
hint_label.pack()
# Feedback label
feedback_label = tk.Label(window, text="")
feedback_label.pack()
if _name_ == "_main_":
main()
13
8.OUTPUT
Fig:8.1
Fig:8.1
14
Fig:8.3
Fig:8.4
15
9.CONCLUSION
In conclusion, the word guessing game is not just a source of entertainment but also a valuable tool for
enhancing vocabulary, critical thinking, and communication skills. Through the process of guessing
words based on contextual clues or limited information, players develop their cognitive abilities and
linguistic prowess. Moreover, the game fosters teamwork, cooperation, and creativity as participants
work together to unravel the mystery behind each word. Whether played casually among friends or as a
structured educational activity, the word guessing game remains a timeless favorite, offering endless
opportunities for fun and learning.
16
10.SKILL DEVELOPED / LEARNING OUTCOMES OF MICRO PROJECT
1) Communication
2) Leadership
3) Team management
4) Negotiation
5) Personal organization
6) Risk management
7) Critical thinking
8) Task management
17
APPLICATIONS OF MICRO – PROJECT
1) Education: Teachers can use the game to make learning vocabulary more engaging and
interactive for students. It can be incorporated into language arts lessons to reinforce
word meanings, spelling, and comprehension skills.
2) Language Learning: The game can be utilized in language learning programs to help
learners improve their language proficiency by practicing vocabulary and understanding
context.
3) Team Building: Companies and organizations can use the game as a team-building
activity to improve communication, collaboration, and problem-solving skills among
employees.
4) Therapy and Rehabilitation: The game can be adapted for use in speech therapy and
rehabilitation programs to help individuals improve their language and cognitive abilities
in a fun and stimulating way.
5) Entertainment: The project can be developed into a mobile app or online game for
entertainment purposes, allowing people to play and enjoy the game solo or with friends
and family.
11.REFERERNCE
1. https://en.wikipedia.org/wiki/Word_game
2. https://boardgamegeek.com/boardgamefamily
/62861/word-games-guess-word
3. https://www.geeksforgeeks.org/python-
program-for-word-guessing-game/
18