Closed AbrahamAvelar closed 3 years ago
A practice that is not uncommon is to append an underscore to a variable name that conflicts with a built-in, e.g. in this case sum_
.
I agree that cumulativesum or total may be better. sum is good too but I think may be confussing to novices. Anyways I believe the important thing is to change the original name from the lesson as it is confussing, even more as in the method sum() is used in the "Writing Functions" episode. When running sequencially, the error comes from python trying to use it as a variable name. How do we get the change in the SC lesson?
I agree that cumulativesum or total may be better. sum is good too but I think may be confussing to novices. Anyways I believe the important think is to change the original name from the lesson as it is confussing, even more as in the method sum() is used in the "Writing Functions" episode. When running sequencially, the error comes from python trying to use it as a variable name. How do we get the change in the SC lesson?
If you're OK with cumulative_sum
or total
I'd be happy to merge after renaming summatory
-> cumulative_sum
- you can do this by adding another commit to your PR branch. Let us know if you need help with it, and thanks again for the PR!
As "sum" is a built-in function, it is better to name this variable something different.