Python - Using for loop with range

Introduction

For loop and range together provide a simple way to repeat an action a specific number of times.

To print three lines, use a range to generate the appropriate number of integers:

Demo

for i in range(3): 
   print(i, 'Pythons')

Result

Related Topic