You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To do this, all references to self.attribute or cls.attribute need to be removed. Any attributes that are set must be passed back in the return value to the calling function.
Change _calculate_avg_summer_usage() => avg_summer_usage = cls_get_avg_summer_usage(bills_summer)
Do in two steps.
Part 1 - avg_summer_usage
rename _calculate_avg_summer_usage to _get_avg_summer_usage
at the end of the initializing function, add self.avg_summer_usage = avg_summer_usage
When all functional programming is done, you can figure out how to do this differently
Part 2 - bills_summer
Change self.bills_summer to bills_summer
Add bills_summer as a paramter to _get_avg_summer_usage and pass it when the function is called
The text was updated successfully, but these errors were encountered:
ethanstrominger
changed the title
Refactor to use functional programming paradigm
Refactor to use functional programming for _calculate_avg_summer_usage
Nov 12, 2024
To do this, all references to self.attribute or cls.attribute need to be removed. Any attributes that are set must be passed back in the return value to the calling function.
_calculate_avg_summer_usage()
=>avg_summer_usage = cls_get_avg_summer_usage(bills_summer)
Do in two steps.
Part 1 - avg_summer_usage
=>
avg_summer_usage = cls_get_avg_summer_usage()`When all functional programming is done, you can figure out how to do this differently
Part 2 - bills_summer
The text was updated successfully, but these errors were encountered: