Python_Microproject(08)
Python_Microproject(08)
MICRO PROJECT
Academic year 2024-25
TITLE OF PROJECT
1
Teacher Evaluation Sheet
Name of Student: Waghchaure Pranjal Sambhaji
Enrolment No: 23651020423
Name of Program: Computer Technology Semester:-VI
Course Title: Programming with Python (PWP) Code: -22616
Title of the Micro Project: Calculator Using Class and Object
Sr.
Characteristic to be Poor Average Good Excellent
No.
assessed (Marks 1-3) (Marks 4-5) (Marks 6 - 8) (Marks 9-10)
(A) Process and Product Assesssment (Convert above total marks out of 6 marks)
1 Relevance to the Course
Literature Survey /
2
Information Collection
Completion of the Target as
3
per project proposal
Analysis of data and
4
representation
5 Quality of Prototype / Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)
8 Presentation
9 Viva
Micro – Project Evaluation Sheet:
Process Assessment Product Assessment
Part Project Part Individual Total
A – project Methodology B – Project Presentation / Marks 10
Name of Student Proposal (2 marks) Report / Working Viva (4 marks)
(2 marks) Model(2 marks)
Comments / Suggestions about team work / leadership / inter – personal communication (if any)
2
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
CERTIFICATE
This is to certify- Waghchaure Pranjal Sambhaji
Place: CHANDWAD
Date: / /2024
3
INDEX
Part A
5
1.0 Aim of Micro Project
5
2.0 Brief Introduction
5
3.0 Course Outcomes Achieved
5
4.0 Action Plan
Part B
7
1.0 Aim of Micro Project
7
2.0 Brief Introduction
7
3.0 Course Outcome Addressed
7
4.0 Actual Resource Used
8-11
5.0 Actual Methodology
8-11
6.0 Outputs of the Micro-projects
4
PART A-Plan
We shall be breaking down our procedure of making the calculator program in python into simple
steps. To assist understand the concepts in depth, for making a simple calculator program in python
that can execute basic mathematical operations such as addition, subtraction, multiplication, or
division, all of which rely upon the input given by the user.
• Prompting Input from the User. That is, we shall be accepting input for two variables.
• Define and Add operators or functions such as add(), subtract(), multiply(), and divide() to
estimate respective functions.
• To make it similar to the calculator, apply conditional statements (if…elif…else
branching) to make it works as per User’s choice
5
5.0 Resource Required
Sr.No Name of Resource/Material Specification Quantity Remarks
1. Computer (Desktop/Laptop) I5,RAM 8GB 1 Available
2. Microsoft office word 2010 1 Available
3. Books Python- 1 Available
4. Websites www.google.com Available
5. Softwares IDLE (Python 3.9 64-Bit) 1 Available
6
PART B-Plan
We shall be breaking down our procedure of making the calculator program in python into simple
steps. To assist understand the concepts in depth, for making a simple calculator program in
python that can execute basic mathematical operations such as addition, subtraction,
multiplication, or division, all of which rely upon the input given by the user.
• Prompting Input from the User. That is, we shall be accepting input for two variables.
• Define and Add operators or functions such as add(), subtract(), multiply(), and divide() to
estimate respective functions.
• To make it similar to the calculator, apply conditional statements (if…elif…else
branching) to make it works as per User’s choice
3.0 Course Outcomes Addressed:
1) CO-a Display messages on screen using Python script on IDE.
2) CO-b Develop Python program to demonstrate use of Operators.
3) CO-c Perform operations on data structures in Python.
4) CO-d Develop functions for given problem
5) CO-e Design classes for given problem.
6) CO-f Handling Operations
7
5.0 Actual Methodology/Procedure Followed:
6.0 Output/Code:
• Step 1: Prompting Input from the User, we shall accept input for two variables.
In this step, we shall take the user's input utilizing the input() function in python. It is the
same as when we enter numbers in a real calculator to execute any arithmetic operations. We
shall ask the user to input two variables utilizing each variable's input() function.
Let’s have the program execute the prompt for the two numbers:
Output:
•
8
Step 2: Define and Add operators or functions such as add(), subtract(), multiply(), and divide() to
estimate respective functions.
Now we are adding the functions to execute the mathematical operations such as addition,
subtraction, multiplication, and division to make the computation for the calculator program in
python. We also changed our input functions to integers to guide the user to perform the arithmetic
operations on integers, not strings.
• Code:
• Output:
9
Above, we have represented each of the four basic arithmetic operations in python utilizing the
format() function. format() functions fill the placeholder and create the output formatted. The user's
input was now calculated for each arithmetic operation we defined.
As all the functions are getting performed expressed for the two numbers, we have to make it work
per the user's choice. We shall utilize conditional statements - if…elif…else branching so that it only
performs the operations based on the user’s selection of operation like in a real calculator.
To create it at the user's choice based, we shall be defining each of the arithmetic operations as a
function utilizing the def function in python. We will again ask for the user's input for the
mathematical operations that they want to execute.
• Code:
print("Hi, I am a Calculator!")
print("Please select which of the following arithematic operation you want me to
perform-\n" \
10
"1. Add\n" \
"2. Subtract\n" \
"3. Multiply\n" \
"4. Divide\n")
# Taking the input from the user for which arithmetic operation to perform
operation = int(input(" 1, 2, 3 or 4 :"))
if operation == 1:
print(number_1, "+", number_2, "=",
add(number_1, number_2))
elif operation == 2:
print(number_1, "-", number_2, "=",
subtract(number_1, number_2))
elif operation == 3:
print(number_1, "*", number_2, "=",
multiply(number_1, number_2))
elif operation == 4:
print(number_1, "/", number_2, "=",
divide(number_1, number_2))
else:
print("Please enter Valid input")
• Output
Hi, I am a Calculator!
Please select which of the following arithmetic operation you want to perform-
1. Add
2. Subtract
3. Multiply
4. Divide
1, 2, 3 or 4 :3
Please, Enter the first number: 10
Please, Enter the second number: 20
10 * 20 = 200
11
Skill Developed out of this Micro-Project
• Able to get all information about how to create a calculator using python.
9.0 Conclusion
We created our calculator program in python established on the user's choice of input of
numbers and operators, precisely how a real calculator works.
10.0 References
• www.wikipedia.com
• www.researchgate.net
• www.google.com
12
10