👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

How to write a for loop in a given range in Python?

In Python, the syntax for writing a for-loop in a given range is simply:

>>> for i in range(-2, 3):
>>> 	print(i)
-2
-1
0
1
2

More