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

Python

The document describes a project to create a calculator using classes and objects in Python. A group of 5 students will work on the project. They plan to define functions for addition, subtraction, multiplication, and division and use conditionals to call the appropriate function based on user input. Their goal is to build a basic calculator and potentially improve it to be a scientific calculator.

Uploaded by

Harsh Mate
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)
43 views

Python

The document describes a project to create a calculator using classes and objects in Python. A group of 5 students will work on the project. They plan to define functions for addition, subtraction, multiplication, and division and use conditionals to call the appropriate function based on user input. Their goal is to build a basic calculator and potentially improve it to be a scientific calculator.

Uploaded by

Harsh Mate
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/ 7

DHARAMPETH POLYTECHNC

2022- 2023
SUBJECT:- Programming With Python

BRANCH:- Computer Technology(CM6I)

TOPIC : Create a Calculator Using Class And Object Using


Python

SUBMITTED TO:- Meeta Fadnavis Mam.

Group members:- 1) Harsh Mate

2) Archit Yadav

3) Kunal Jaiswal

4) Mohit Bhelkhede

5) Yash Bajpai
ANNEXURE-1
1. Rationale (Aim): Create a Calculator Using Class And
Object Using Pytho

2. Littrature Review:
a) Ms.word
b) Google
c) http://www.wikipedia.org

3.Action plan
Details of Planned start Planned finish Name of
activity date date responsible
team members
Making 20/03/2023 20/09/2023 Harsh
introduction
Collecting 20/03/2023 20/03/2023 Archit
information
Preparation of 20/03/2023 20/03/2023 Kunal
chart
Material for 20/03/2023 20/03/2023 Mohit
chart
Print the form 20/03/2023 20/03/2023 Yash

4.Resources Requried:-
Sr no Name of materials Specification
1. Ms.Word -
2. Hardware Computer System Computer (i3-i5),
RAM 2GB-4GB,
HDD upto 40GB.
3. Operating System Windows,lunix,mac-
os
4. Software Vs code/sublime text
editor
ANNEXURE-2

1. Rationale:
Two numbers are taken and an if...elif...else branching is used to
execute a particular section. User-defined functions add() ,
subtract() , multiply() and divide() evaluate respective operations
and display the output.
2. Course Outcome : A Simpal Calculator Build Using Python
Programming Languge.

3. Actual Procedure Followed :


Brief Introduction :-
What is Python with example?
Python is a high-level, interpreted, interactive and object-oriented
scripting language. Python is designed to be highly readable. It
uses English keywords frequently where as other languages use
punctuation, and it has fewer syntactical constructions than other
languages.

What is calculator explain?


A calculator is a device that performs arithmetic operations on
numbers. The simplest calculators can do only addition,
subtraction, multiplication, and division.... Internally, some
calculators actually perform all of these functions by repeated
processes of addition.

Who invented calculator?


In 1642, a French Mathematician and Physicist, Blaise Pascal
invented mechanical calculators. Those calculators were also
known as Pascaline. In 1642, a French Mathematician and
Physicist, Blaise Pascal invented mechanical calculators. Those
calculators were also known as Pascaline.

Information about project


In this program we can create a calculator in this calculator we can
use class and object but also we can create four option such as
exit,addition,substraction,multiplication,division when we can
choose the option then answer displays but first we can enter two
number then the answer will be displayed
In this choise
0 Is For Exit
1 Is For Addition
2 Is for Substraction
3 Is Multiplication
4 Is for Division
Programme Code:-

def add(P, Q):

return P + Q

def subtract (P, Q)

return P - Q

def multiply v(P, Q)


return P Q

def divide(P, Q):

return P/Q

print ("Please select your choise.")

print ("1. Add (+)")

print ("2. Subtract (-)")


print ("3. Multiply (*)")

print ("4. Divide ('')

choice input("Please enter choice (1/2/3/4): ")

Bum 1int (input ("Please enter the first number. "))

num 2 =int (input ("Please enter the second number: "))

if choice-'1

print (num 1 i^ prime prime +^ prime prime , 2 ,^ prime prime =^


prime prime add(num_1 |, nu m\ 2)

slif choice='2'
print (num_1,"", num 2 ,^ prime prime =" , subtract(num_1, num_2))

elif choice-'3'

print ( numi * 1 , "", 2 ,^ prime prime =" , multiply(num_1, num_2))

elif choice Rightarrow^ prime 4'

print (mim 1, "/", num 2 ,^ prime prime =" , divide(num_1 nu m\ 2)

print ("This is an invalid input")

5.Output:-

6.Skill Developed : How To Code In Python And Use


Multiway(ladder ) Statement

7.Area of future improvement : We can improve our basic


calculator into scientific calculator.

 Don’t burn leaves, trash, and other smoky materials.


 Don’t use gas-powered lawn and garden equipment like blowers.
 Delay the number of trips you take in your car or motorcycle.
 Lessen your fireplace and wood stove usage.
 Don’t barbeque in your grill.
 Don’t burn leaves, trash, and other smoky materials.
 Don’t use gas-powered lawn and garden equipment like blowers.
 Delay the number of trips you take in your car or motorcycle.
 Lessen your fireplace and wood stove usage.
 Don’t barbeque in your grill

 Don’t burn leaves, trash, and other smoky materials.


 Don’t use gas-powered lawn and garden equipment like blowers.
 Delay the number of trips you take in your car or motorcycle.
 Lessen your fireplace and wood stove usage.
 Don’t barbeque in your grill.

You might also like