Python Iterators Explained

If you have written some Python code and used the for loop, you have already used iterators behind the scene but you probably didn’t know about it. Iterators are objects that we can iterate over one by one. They are practically everywhere in a Python code… Read more

Similar

Zip in Python

zip takes n number of iterables and returns list of tuples. ith element of the tuple is created using the ith element from each of the… (more…)

Read more »

Be Careful with Python’s New-Style String Format

This should have been obvious to me for a longer time, but until earlier today I did not really realize the severity of the issues caused by str.format on untrusted user input. It came up as a way to bypass the Jinja2 Sandbox in a way that would permit r...

Read more »