Angular Sum Array Python Methods Vs Functions