If i is not 0
if ( i ) : NEW_LINE INDENT left_sum . append ( left_sum [ i - 1 ] + arr [ i ] ) NEW_LINE right_sum . append ( right_sum [ i - 1 ] + arr [ len ( arr ) - 1 - i ] ) NEW_LINE DEDENT else : NEW_LINE INDENT left_sum . append ( arr [ i ] ) NEW_LINE right_sum . append ( arr [ len ( arr ) - 1 ] ) NEW_LINE DEDENT