Explain the working of the for loop with an appropriate example,
Answers
Answered by
3
Explanation:
let take a example to print positive integer
by for loop
#here user enter n= 10
Output = 1,2,3,4,5,6,7,8,9,10
for i in range(1,n+1):
print(I)
i = variable
range is a function
1,n+1 is limit
n+1 is taken to end upto 10 so take one-step ahead
#mark me as brainly
follow me
Similar questions