why we are entering num_2+1 and num_1+1 in for loop code
num_2+1 and num_1+1
in for loop why we are using 1+1,2+1
Thank you for your question!
The reason we are adding one is because of how the
range() function works. Imagine that you want to print the numbers from 1 to 10, including 10. If I attempt to do that with
range(1, 10), I will get the following output:
What I need to do to output 10 as well is to add 1 to 10 as follows:
Therefore, if we want to include the numbers
num_2, we need to add one in the
Hope this helps!