Write for loops that use the function range and print the fo

Write for loops that use the function range() and print the following sequences: (a) 0 1 (b) 0 (c) 3 4 5 6 (d) 1 (e) 0 3 (f) 5 9 13 17 21

Solution

for i in range(0,2):
   print(i)
for i in range(0,1):
   print(i)
for i in range(3,7):
   print(i)
for i in range(1,2):
   print(i)
for i in range(0,4,3):
   print(i)
for i in range(5,22,4):
   print(i)

Write for loops that use the function range() and print the following sequences: (a) 0 1 (b) 0 (c) 3 4 5 6 (d) 1 (e) 0 3 (f) 5 9 13 17 21Solutionfor i in range(

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site