Q:

How to force range loop to be executed at least once

In python, we can use the following loop:
for k in range(n, m):
   pass

where nand mare two integers.
If n == m the loop is ignored (doesn't executed). How to force the program to execute the loop at least once?

A:

This is one way:
for k in range(n, max(n+1,m)):

