0% found this document useful (0 votes)
10 views24 pages

ST. Thomas School

The document presents a Python project by Yesh from Class 11 A, focusing on various calculator programs that demonstrate different programming techniques. It includes a basic calculator, scientific calculator, graphical calculator using Tkinter, and additional specialized calculators, along with their code and sample outputs. The project serves as a resource for fellow students to learn Python through practical examples and hands-on experience.

Uploaded by

garv sehrawat
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)
10 views24 pages

ST. Thomas School

The document presents a Python project by Yesh from Class 11 A, focusing on various calculator programs that demonstrate different programming techniques. It includes a basic calculator, scientific calculator, graphical calculator using Tkinter, and additional specialized calculators, along with their code and sample outputs. The project serves as a resource for fellow students to learn Python through practical examples and hands-on experience.

Uploaded by

garv sehrawat
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/ 24

ST.

Thomas School

Computer science Project


Python Project: A Comprehensive Collection of Python Programs and Outputs

Submitted by: Yesh

Class: 11 A

Submitted to: Mr. Sudhir Sir

Date: 7 February 2025


Certificate

Certificate

This is to certify that the project titled

“Python Calculator Project: A Comprehensive


Collection of Python Programs and Outputs”

submitted by Yesh of Class 11 A, under the


supervision of Mr. Sudhir Sir, is an original work
completed by me. All sources used have been duly
acknowledged.

Signature: ____________________

Date: _________________________
Acknowledgement

Acknowledgement

I would like to express my sincere gratitude to Mr.


Sudher Sir for his invaluable guidance,
encouragement, and support throughout this project.
His insightful advice and deep understanding of the
subject have greatly contributed to the successful
completion of this work.

Additionally, I would like to extend my heartfelt


appreciation to my family and friends for their
constant motivation and encouragement, which kept
me focused and dedicated throughout this project.

This project would not have been possible without the


collective support of everyone involved, and I am truly
grateful for their contributions
Table of Contents

Table of Contents

1. Title Page ................................. Page 1


2. Certificate ................................. Page 2
3. Acknowledgement ............................. Page 3
4. Introduction ................................. Page 5
5. Basic Calculator Program .................... Page 7
6. Scientific Calculator Program ............... Page 9
7. Graphical Calculator Program (Tkinter) ...... Page 11
8. Calculator with Exception Handling .......... Page 13
9. Geometric Calculator Program ................ Page 15
10. Additional Calculator Programs ............. Page 17
11. Program Outputs Summary .................... Page 19
12. Conclusion and Discussion .................. Page 21
13. Bibliography ................................. Page 24
14. Appendix .................................... Page 25
Introduction

Introduction

Python is a versatile and beginner-friendly


programming language that has applications in web
development, data analysis, scientific computing, and
more. This project focuses on building several
calculator programs using Python. The primary
objective is to demonstrate various programming
techniques such as function creation, exception
handling, GUI programming, and modular design by
developing applications that perform arithmetic,
scientific, and geometric computations.

This report is structured with minimal theoretical


explanations and emphasizes the actual code and
outputs. The hands-on approach is intended to help
fellow Class 11 students learn by example.
In the sections that follow, you will find code for
several types of calculators:

• Basic Calculator: Performs addition, subtraction,


multiplication, and division.
• Scientific Calculator: Adds operations such as
trigonometric functions, logarithms, and square
roots.
• Graphical Calculator: Uses Tkinter for an
interactive GUI experience.
• Menu-Driven Calculator: Incorporates exception
handling and continuous operations.
• Geometric Calculator: Computes areas and
perimeters of common shapes.

Additional small programs (e.g., factorial and power


calculators) are also included. Each program is
presented with sample outputs to illustrate its
functionality
Basic Calculator Program

Basic Calculator Program

Below is the Python code for a basic calculator that


performs the four basic arithmetic operations.
Basic Calculator Sample Output

Sample Output
Scientific Calculator Program

Scientific Calculator Program

This program extends the basic functionalities to


include operations like sine, cosine, tangent,
logarithm, and square root calculations.
Scientific Calculator Sample Output

Sample Output

Graphical Calculator (Tkinter)

Graphical Calculator Program using Tkinter

The following code creates a simple GUI calculator


using the Tkinter library. Run this program in an
environment that supports graphical output.
Graphical Calculator Explanation

Note:

Running the above Tkinter program will launch a


window with a clickable interface. You can perform
basic arithmetic operations interactively. The output
appears in the GUI itself.

Calculator with Exception Handling

Calculator with Exception Handling and Menu-


Driven Operations

This program runs in a loop, prompting the user to


select an operation. It handles invalid inputs and
division by zero gracefully.
Exception Handling Sample Output

Sample Output

Geometric Calculator Program

Geometric Calculator Program: This program


calculates the area and perimeter (or circumference)
for several shapes.
Geometric Calculator Sample Output

Sample Output (Circle Selected)

Additional Calculator Programs

Additional Calculator Programs

Below are two more programs that perform


specialized calculations:
1. Factorial Calculator

2. Power Calculator

Additional Programs Sample Output


Program Outputs Summary

Summary of Program Outputs

• Basic Calculator:
o Addition, Subtraction, Multiplication, Division
• Scientific Calculator:
o Sine, Cosine, Tangent, Logarithm, Square
Root
• Graphical Calculator (Tkinter):
o Interactive GUI-based arithmetic operations
• Menu-Driven Calculator with Exception
Handling:
o Continuous operations with error handling
• Geometric Calculator:
o Area and perimeter/circumference for circles,
rectangles, and triangles
• Additional Programs:
o Factorial and Power Calculators

Note: The outputs shown are samples. Actual outputs


will depend on user input during program execution.
Additional Output Notes

Additional Output Information

This section provides a brief recap of the outputs:

• Each program’s output is displayed immediately


after execution.
• GUI outputs (for the Tkinter calculator) appear in a
separate window.
• For console-based programs, sample outputs
illustrate the expected behavior.
• Ensure that your Python environment is correctly
configured to run GUI applications if you wish to
test the Tkinter code.
Conclusion and Discussion

Conclusion and Discussion

This project demonstrates a practical approach to


learning Python by developing several calculator
programs. The projects range from simple arithmetic
operations to more advanced features such as
scientific computations and graphical interfaces.
Emphasis was placed on the programming and
outputs rather than lengthy explanations, making it
easier for students to see immediate results and learn
through practice.

The iterative development and testing of these


programs have deepened my understanding of
Python’s functions, error handling, recursion, and GUI
programming. The hands-on experience acquired
through this project serves as a strong foundation for
further exploration into computer science.

Summary
• The project includes multiple calculator programs
that highlight different aspects of Python
programming.
• Code samples and corresponding outputs
demonstrate practical applications.
• The interactive GUI-based calculator shows the
potential for creating user-friendly applications.
• This project is intended as a resource and learning
tool for fellow students.
Final Remarks

Final Remarks

In conclusion, the “Python Calculator Project” not


only illustrates various programming techniques but
also encourages experimenting with Python to solve
real-world problems. I hope this project becomes a
useful reference for my classmates and inspires
further exploration into programming and computer
science.
Bibliography

Bibliography

1. Python Official Documentation – Python


Software Foundation.
(https://docs.python.org/3/)
2. Learning Python by Mark Lutz – O’Reilly Media.
3. Think Python: How to Think Like a Computer
Scientist by Allen B. Downey – O’Reilly Media.
4. Tkinter — Python interface to Tcl/Tk
(https://docs.python.org/3/library/tkinter.html)
5. Various online tutorials and resources on Python
programming and calculator projects.
Appendix

Appendix

Additional Notes:

• Code Comments: Each program contains inline


comments to explain its functionality.
• Troubleshooting Tips:
o Ensure that Python is installed on your
system.
o For Tkinter-based programs, verify that your
Python distribution supports Tkinter.
o Check for syntax errors if the code does not
run as expected.
• Enhancements for Future Work:
o Expand the graphical calculator with
additional features (e.g., memory functions,
advanced operators).
o Incorporate unit testing for the calculator
functions.
• Contact: For further discussion or questions
regarding this project, feel free to contact me,
Yesh.

You might also like