Sha256: 4cb9fce280fb036b8f12d4b682642f001bd52e5158caa85e6e2b74388926405e

Contents?: true

Size: 242 Bytes

Versions: 91

Compression:

Stored size: 242 Bytes

Contents

def square_of_sum(count):
    sum_ = count * (count + 1) / 2
    return sum_ * sum_


def sum_of_squares(count):
    return sum(m * m for m in range(count + 1))


def difference(count):
    return square_of_sum(count) - sum_of_squares(count)

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.158 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.157 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.156 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.155 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.154 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.153 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.152 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.151 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.150 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.149 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.148 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.147 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.146 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.145 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.144 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.143 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.142 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.141 tracks/python/exercises/difference-of-squares/example.py
trackler-2.2.1.140 tracks/python/exercises/difference-of-squares/example.py