Search⌘ K

Challenge 3: Implement a Calculator Class

Explore how to implement a Calculator class in Python by defining an initializer and methods for basic arithmetic operations. This lesson helps you practice creating and using properties and methods within a class, improving your understanding of Python object-oriented programming techniques.

Problem statement

Write a Python class called Calculator by completing the tasks below:

Task 1

Initializer

Implement an initializer to initialize the values of num1 and num2.

Properties

  • num1
...