I try to understand the OOP and sketched a class that takes two numbers, then it must multiply them, then divide and at the end of the results of these two methods display
class Numbers_Class: def __init__(self, value1, value2): self.value1 = value1 self.value2 = value2 def multiply(self): self.value1*self.value2 def devision(self): self.value1/self.value2 def get_list(self): return [self.value1, self.value2] num_class = Numbers_Class(10, 5) print(num_class.get_list()) As a result, he prints [10, 5], but I want to get [50, 2]. How can I do it?
The essence of all these actions, I want to write a class in which there will be a bunch of methods, I will transfer data to it during initialization and after that I would like to call one get_list () method a sheet with the data in which there will be grouped information from each method. How to make methods run in class? So that I, in a miracle machine, poured milk roughly and put in sugar, and at the output received ice cream. without causing intermediate methods, did not press the button, freeze milk, mix sugar with milk and so on, and so that the class itself calls them.