0% found this document useful (0 votes)
16 views10 pages

Python Micro

This micro-project involves creating a Rock, Paper, Scissors game using Python, aimed at fulfilling the Diploma in Computer Technology requirements. The project utilizes the Tkinter library for GUI development, allowing users to play against a computer opponent with standard game rules. It emphasizes skills in problem-solving, event handling, and GUI design, with potential for future enhancements like score tracking and animations.

Uploaded by

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

Python Micro

This micro-project involves creating a Rock, Paper, Scissors game using Python, aimed at fulfilling the Diploma in Computer Technology requirements. The project utilizes the Tkinter library for GUI development, allowing users to play against a computer opponent with standard game rules. It emphasizes skills in problem-solving, event handling, and GUI design, with potential for future enhancements like score tracking and animations.

Uploaded by

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

A MICRO-PROJECT

ON
Rock, Paper, Scissors Game Using Python

Session:- 2024-25

This Micro-Project work is a partial fulfilment of requirement for the award of


Diploma in Computer Technology for subject “Python With Programming”.
Under The Guidance Of
Prof. S.K. Kharkate
(Lecturer in Computer Technology)

Students Name Roll No.


Tanmay M. Warthe 22

Government Polytechnic, Bramhapuri


Dist- Chandrapur
Department Of Computer Technology
This is to certify that the following student of this institute have carried out this
Micro-Project Work on “Rock, Paper, Scissors Game Using Python ”under the
guidance of Prof. S. K. Kharkate in the Department of Computer Technology
during the session 2024-25. This work has been done in the partial fulfilment of the
award for Diploma in Computer Technology from Maharashtra State Board Of
Technical Education, Mumbai.

Submitted By:-

Students Name Roll No.


Tanmay M. Warthe 22

Project Guide Head Of Department


Prof. S.K. Kharkate Prof. S.K. Kharkate
PART A :- A MICRO-PROJECT PROPOSAL

1.0 BRIEF INTRODUCTION

Rock, Paper, Scissors game is a simple yet fun hand game played between two
participants, often used as a decision-making tool. In this Python-based version, the
game allows a user to compete against the computer. The player selects Rock, Paper,
or Scissors, and the computer randomly generates its choice. The winner is determined
based on the classic rules: Rock beats Scissors / Scissors beats Paper / Paper beats
Rock

2.0 AIM OF THE MICRO-PROJECT

Rock Paper Scissors Game using Python.

3.0 COURCE OUTCOMES

a) Display message on screen using Python script on IDE.


b) Develop python program to demonstrate use of Operators
c) Develop functions for given problem.
d) Design classes for given problem..

4.0 LITERATURE REVIEW

The Rock Paper Scissors game is a simple yet engaging project demonstrating
randomization, GUI development, event handling, conditional logic, user
interaction, and real-time feedback. Implemented in Python using the Tkinter
library, it allows users to select moves and compete against a randomly generated
computer choice. The game logic follows standard rules, comparing choices to
determine the winner. Future enhancements can include animations, score
tracking, and multiplayer functionality for a better experience.

 lambda → Used in command=lambda x=choice: self.play(x) for passing arguments to the function inside a
button click.
 pack → Used for arranging buttons and labels in the Tkinter window (.pack(pady=10)).
 random → Used for generating the computer's choice (random.choice([...])).
 config → Used to update labels dynamically (self.result_label.config(text="...")).
 tk → Tkinter module, used to create the GUI (import tkinter as tk).
 title → Sets the window title (self.window.title("Rock Paper Scissors - 3 Rounds")).
 geometry → Sets window size (self.window.geometry("300x300")).
 window → Refers to the Tkinter window instance (self.window = tk.Tk()).
 __init__ → Constructor method used to initialize class variables.
5.0 PROPOSED METHODOLOGY

Algorithm for Rock, Paper, Scissors Game

 Start
 Create the main window using Tkinter and set the title and size.
 Retrieve the "Rock", "Paper", and "Scissors" buttons using Tkinter’s Button widget.
 Define a label to display instructions for the user.
 Define an empty label (result_label) to display the game result.
 Create an event listener for each button that triggers when clicked.
 Inside the event:
o Get the player's choice from the clicked button.
o Generate the computer's choice randomly from the list: ['Rock', 'Paper',
'Scissors'].
o Compare the player's choice with the computer's choice:
 If both choices are the same, display "It's a Tie!".
 If the player wins based on game rules, display "You Win!".
 Otherwise, display "Computer Wins!".
o Update the result_label to show the choices and the result.
 Start the Tkinter main event loop to run the application.
 End

6.0 RESOURCES USED

Sr. No. Name of the Specification


resource/Material
used
1. Laptop i9, 1TB , 16 GB RAM

2. Software MS Word

3. Other resources Notes, Reference Books

4. Search Engine Google Chrome


7.0 ACTION PLAN

Sr. Planned Start Planned Finish Name of


Details of Activity
No Date Date Student

1 Discuss About The Topic Jan 20, 2025 Jan 22, 2025

Information Search and


2 Jan 23, 2025 Jan 26, 2025
Resource Collection

3 Discuss with Project Guide Jan 27, 2025 Jan 29, 2025

4 Implement Part A Jan 30, 2025 Feb 4, 2025 Tanmay


Warthe
5 Implement Coding Feb 5, 2025 Feb 12, 2025

Testing and Correction of


6 Feb 13, 2025 Feb 18, 2025
Errors

7 Implement Part B Feb 19, 2025 Feb 24, 2025

8 Submission of Final Report Feb 25, 2025 Feb 27, 2025

:
\
PART B:- Micro-Project Proposal

1. 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.

2. Aim Of The Project

Rock Paper Scissors Game using Python.

3. Course Outcomes Achieved

e) Display message on screen using Python script on IDE.


f) Develop python program to demonstrate use of Operators
g) Develop functions for given problem.
h) Design classes for given problem.

4. Literature Review

The Rock Paper Scissors game is a simple yet engaging project demonstrating
randomization, GUI development, event handling, conditional logic, user
interaction, and real-time feedback. Implemented in Python using the Tkinter
library, it allows users to select moves and compete against a randomly generated
computer choice. The game logic follows standard rules, comparing choices to
determine the winner. Future enhancements can include animations, score
tracking, and multiplayer functionality for a better experience.

 lambda → Used in command=lambda x=choice: self.play(x) for passing arguments to the function inside
a button click.
 pack → Used for arranging buttons and labels in the Tkinter window (.pack(pady=10)).
 random → Used for generating the computer's choice (random.choice([...])).
 config → Used to update labels dynamically (self.result_label.config(text="...")).
 tk → Tkinter module, used to create the GUI (import tkinter as tk).
 title → Sets the window title (self.window.title("Rock Paper Scissors - 3 Rounds")).
 geometry → Sets window size (self.window.geometry("300x300")).
 window → Refers to the Tkinter window instance (self.window = tk.Tk()).
 __init__ → Constructor method used to initialize class variables.
5. Actual Methodology Followed

Algorithm for Rock, Paper, Scissors Game

 Start
 Create the main window using Tkinter and set the title and size.
 Retrieve the "Rock", "Paper", and "Scissors" buttons using Tkinter’s Button widget.
 Define a label to display instructions for the user.
 Define an empty label (result_label) to display the game result.
 Create an event listener for each button that triggers when clicked.
 Inside the event:
o Get the player's choice from the clicked button.
o Generate the computer's choice randomly from the list: ['Rock', 'Paper',
'Scissors'].
o Compare the player's choice with the computer's choice:
 If both choices are the same, display "It's a Tie!".
 If the player wins based on game rules, display "You Win!".
 Otherwise, display "Computer Wins!".
o Update the result_label to show the choices and the result.
 Start the Tkinter main event loop to run the application.
 End

6. Resources used

Sr.
Name of the resource/Material used Specification
No.
1. Laptop i9, 1TB,16 GB RAM

2. Software MS Word

3. Other resources Notes, Reference


Books

4. Search Engine Google Chrome


7. Program Code

Main.py

import random
import tkinter as tk
from tkinter import messagebox

def play_game(player_choice):
choices = ['Rock', 'Paper', 'Scissors']
computer = random.choice(choices)

result_text = f"Your choice: {player_choice}\nComputer's choice: {computer}\n\n"

if player_choice == computer:
result_text += "It's a Tie!"
elif ((player_choice == 'Rock' and computer == 'Scissors') or
(player_choice == 'Paper' and computer == 'Rock') or
(player_choice == 'Scissors' and computer == 'Paper')):
result_text += "You Win!"
else:
result_text += "Computer Wins!"

result_label.config(text=result_text)

window = tk.Tk()
window.title("Rock Paper Scissors")
window.geometry("300x250")

instructions = tk.Label(window, text="Choose Rock, Paper, or Scissors", font=('Arial', 12))


instructions.pack(pady=10)
button_frame = tk.Frame(window)
button_frame.pack(pady=20)

for choice in ['Rock', 'Paper', 'Scissors']:


tk.Button(button_frame, text=choice, width=8,
command=lambda x=choice: play_game(x)).pack(side=tk.LEFT, padx=5)

result_label = tk.Label(window, text="", font=('Arial', 11))


result_label.pack(pady=20)

window.mainloop()

8. Output
9. Skill Developed:
Problem-Solving – Understanding game logic, implementing conditions, and
debugging.
GUI Development – Using Tkinter to create an interactive user interface.
Event Handling – Managing user inputs and updating the interface dynamically.

10. Conclusion

The Rock Paper Scissors game is a great beginner project for learning Python, GUI
design, and logic building. It improves problem-solving skills and provides an
interactive experience. The game can be expanded with more features like score tracking
and animations to make it even more engaging.

You might also like