Python Summation Function

preview_player
Показать описание
The function takes one argument , a number and return the total of all numbers from zero to that number. For instance if you pass in a 10, then it will add numbers 0-10, snd give you a 55.

Thumbnail: Photoshop designed
Video editing: Windows video editor and adobe premiere

Рекомендации по теме
Комментарии
Автор

I've seen several examples where people thought that "range(x)" would give the correct value. I'm happy to see you use "range(x+1)".

sloanlance
Автор

lol 😂
just go (n * (n - 1)) // 2 that's about 10000 times faster...

dgh