In this video, I will show you how to calculate the sum of 1+2+3+...+N using a Python program with a loop, and then I will show you how to also calculate the sum of series using recursion.
What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself and to find the sum of a series using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.
You could also calculate the sum from 1 to N or N to 1 using this formula: n(n+1)/2, assuming the steps is 1 meaning it is the series of i=1 to i=n of i.
In the next video, I will show you how to print a list or an array using recursion.
LIKE & SUBSCRIBE:
🔴 My Channel: / quocdatphung
🔴 My second channel: / @purifynature8479
MY EQUIPMENT:
✅Camera: Samsung Galaxy J7
✅Recording Equipment: https://obsproject.com/
✅Editing Software: Shotcut