Deleting Elements of a Python List while Iterating

What will we cover in this tutorial? Step 1: What happens when you just delete elements from a Python list while iterating over it? Let’s first try this simple example to understand the challenge of deleting element in a Python list while iterating over it. Now, looking at this piece of code, it would seem … Read more

Comparing Performance of Python list as a Stack – How a wrong implementation can ruin performance

A Stack? A Stack is using the principle first-in-last-out. It is like a stack of plates. The last one you put on the top is the first one you take. How can you implement them in Python? Well, we are in luck, you can use a Stack, and if done correctly, you will have the … Read more