In this project, Juni instructor Maya will be showing us how to use Python to build our very own calculator.
Practice using conditionals, type conversion, and while loops.
Juni Level: Python Level 2
Core concepts: While loops, Conditionals, Arithmetic Operations
Lines of Code: ~50
Est. Time: ~15-45min, but this varies by student and how creative you get!
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:
The user will input a number.
Then an operation.
Then another number.
And then the program will return the answer.
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:
Want to keep learning?
We hope you enjoyed this project tutorial with Maya!
To keep practicing and learning, please check out all of our coding tutorials on our blog.
Looking up your coding questions is one of the best ways to learn!
Another great way to learn is from an experienced coder or instructor. Juni CS instructors like Maya work closely with students ages 8-18, and are specially trained to adapt to each child's unique learning style, pace, and interests.
Read more about our coding courses for kids and curriculum, or speak with a Juni Advisor today by calling (650) 263-4306 or emailing firstname.lastname@example.org to learn which course is best for your child’s coding journey. You can also read more about how we use Scratch to teach coding.