B. The For Loop Statement
B. The For Loop Statement
for n in numbers:
SUM = SUM + n
print("The sum of the numbers=", SUM)
for i in range(1,10,2):
print (i, end=' ')
Output of the above Programs:
0 1 2 3 4 5 6 7 8 9
23456789
13579
Dr. M. Shubhakanta Singh
The range() function- examples
# incremented by -2
for i in range(20,3,-2):
print (i, end=' ')
for i in result:
numbers: 55
statement-x statement-x