Python 3 crumbs tagged with #for-loop
Your for-loop might be missing an else block
Aug 30, 2022 by erik
There's a little-known construct in Python that can be quite useful: using else in combination with loops. That's right, for-loops and while-loops can be followed by an
else block! Let's look at how you can use the else block in...
Python for loop and lists
Jan 16, 2022 by erik
A Python list can contain zero or more objects. It's a frequently used data type in Python programming. In other programming languages, lists are often called arrays. Python does not have arrays, though, only lists. We can loop, or iterate,...