How do I create an instance variable automatically when the class is initialized?
For example,
class AmortizationSchedule:
__init__(self, principal, interest, num_periods):
self.principal = principal
self.interest = interest
self.num_periods = num_periods
Now how do I create another attribute named schedule that is created automatically when I initialize the class?
self.schedule = some_value?self.scheduledepends onself.interest,self.principalect...