Exercise - Create a calculator

Completed

In this exercise, you build a calculator that uses functions to organize its operations and, optionally, splits its logic across multiple files.

Launch the exercise and follow the instructions.

Button that launches the calculator functions Python exercise in a new browser tab.

Extend with GitHub Copilot

After completing the exercise, try extending it with GitHub Copilot:

  • Ask Copilot to add a new operation—for example, exponentiation or square root—as its own function.
  • Ask Copilot to move all the operation functions into a separate module and import them from the main file.

Review each suggestion carefully before accepting it—make sure you understand what the code does and that it behaves the way you expect.