The range() is an in-built function in Python, which is used to repeat an action for a specific number of times.

Let us give you an example to demonstrate how the range() function works:

Example

                                        

sum = 0
for i in range(1, 11):
    sum = sum + i
print("Sum of first 10 number :", sum)

Output:

Sum of first 10 number: 55

Suggest An Answer

No suggestions Available!