Computer Science, asked by rshashi9295, 5 months ago

the difference between the sum of the first 100 multiples of 8 and the sum of the first 100 multiples off 5

Answers

Answered by jai696
2

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

sum_multiples_8 = sum(m for m in range(8, (100 + 1) * 8, 8))

sum_multiples_5 = sum(m for m in range(5, (100 + 1) * 5, 5))

print(sum_multiples_8 - sum_multiples_5)

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions