Which of the following is better to use and why?
Method 1:
for k, v in os.environ.items(): print \"%s=%s\" % (k, v)
Method 2
If the iteration is being done for its side effect ( as it is in your "print" example ), then a loop is clearer.
If the iteration is executed in order to build a composite value, then list comprehensions are usually more readable.