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
num2
Task 2
Methods
add() is a method that returns the sum of num1 and num2.
subtract() is a method that returns the subtraction of num1 from num2.
multiply() is a method that returns the product of num1 and num2.
divide() is a method that returns the division of num2 by num1.
Input
Pass numbers (integers or floats) in the initializer.
Output
addition, subtraction, division, and multiplication
Sample input
obj = Calculator(10, 94);
obj.add()
obj.subtract()
obj.multiply()
obj.divide()
Sample output
104
84
940
9.4
Coding exercise
Design a step-by-step algorithm before jumping to the implementation. This problem is designed for your practice, so initially try to solve it on your own. If you get stuck, you can always refer to the solution provided in the next lesson.