jerrygerou
3/16/2018 - 9:37 PM

difference_of_squares

def difference_of_squares(n):

    numbers = list(range(1, n+1))
    
    square_of_sum = (sum(numbers) **2)
    
    sum_of_squares = []
    for n in numbers:
        sum_of_squares.append(n **2)
    sum_of_squares = sum(sum_of_squares)
    
    return square_of_sum - sum_of_squares