Apr-22-2025, 12:25 AM
(Apr-21-2025, 07:43 PM)Axel_Erfurt Wrote: Why 2 classes?
class Numbers: def __init__(self,a,b): self.sum = a + b self.prod = a * b twoNumbers = Numbers(5,4) print(twoNumbers.sum, twoNumbers.prod)
Thank you for the offered solution, but I am actually writing a more sophisticated code and I need to access the parent class attributes (not methods) within the child class. The snippet I posted is just an illustration of what I am trying to achieve. My actual code is very big and not suitable for posting here.