Python: How to Make and Use Single Line For-Loops
Overview
This article will explain how to create a for loop in one line of code and why and when using this is preferred than the standard for loop syntax.
Standard For Loop Syntax
A for loop is written with at least two lines:
for i in range(0, 3):
...
andrewdass.hashnode.dev2 min read