The Art of Writing Loops in Python
Simple is better than complex
The for loop is a very basic control flow tool of most programming languages. For example, a simple for loop in C looks like the following:
int i;
for (i=0;i<N;i++)
{
//do something
}
There are no other ways to write a for loop more elegantly in C. For a complex scenario, we usually need to write ugly…