Intermediate Python: Build a Calculator | Juni Learning


A coder uses a normal calculator, thinking about how to recreate it in Python.

Project Overview

In this project, Juni instructor Maya will be showing us how to use Python to build our very own calculator.

Learning outcomes:

Practice using conditionals, type conversion, and while loops.

  • Language: Python

  • Juni Level: Python Level 2

  • Core concepts: While loops, Conditionals, Arithmetic Operations

  • Lines of Code: ~50

  • Difficulty:Easy/Moderate

  • Est. Time: ~15-45min, but this varies by student and how creative you get!

Project Instructions:

Build your own program in Python that functions as a calculator. Think of how a typical calculator works in real life as your starting point, and then brainstorm how to break this down into smaller steps you'll need to add into your code.

This is how Maya broke down a calculator into implementable steps:

  1. The user will input a number.

  2. Then an operation.

  3. Then another number.

  4. And then the program will return the answer.

  5. The calculator will keep asking for input until the user tells it to stop.

Try to do the project on your own first, and get creative with it if you want!

If you get stuck or want to check your code, check out Maya’s solution and tutorial video below.

Project Solution & Tutorial Video

Check your answers or get help by viewing Maya's solution and step-by-step video tutorial:

Maya's solution tutorial:

Need help or want to keep learning?

We hope you enjoyed Maya's Python project!

To keep practicing or learning, please check out all of our coding and math tutorials on our Home Learning Resources page. You can also subscribe to our newsletter for weekly updates with our latest at-home learning resources.

Need help? Looking up your questions is one of the best ways to learn! Another great way to learn is from an experienced coder or instructor. Learn more about our group and private CS classes with live instructors, or our award-winning coding curriculum.