codeforces/596B_array.py
def calculate(self):
        """ Main calcualtion function of the class """

        result = 0
        delta = 0

        for i in range(self.n):
            result += abs(self.nums[i] - delta)
            delta = self.nums[i]

        return str(result)
 Main calcualtion function of the class 
Main calcualtion function of the class
Main calcualtion function of the class
def calculate(self):
        result = 0
        delta = 0
        for i in range(self.n):
            result += abs(self.nums[i] - delta)
            delta = self.nums[i]
        return str(result)
def calculate ( self ) : result = 0 delta = 0 for i in range ( self . n ) : result += abs ( self . nums [ i ] - delta ) delta = self . nums [ i ] return str ( result )
Main calcualtion function of the class
Main calcualtion function of the class
""" Main calcualtion function of the class """
self