I've been learning Python and in order to put my skills to the test, I created a simple program that returns the sum of all of the multiples of number
num up to 1000.
def get_multiple_sum(num): sum = 0 i = 0 for i in range(0, 1001): if i % num == 0: sum += i else: continue return sum
Is this the fastest way to do this? I'm always looking for ways to make my code more efficient.