<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sum(self, projection=None):
 """ Takes sum of elements in sequence. 10 3 :param projection: function to project on the sequence before taking the sum :return: sum of elements in sequence """

        if projection:
            return sum(self.map(projection))
        else:
            return sum(self)