Software engineering and personal development

Tag: render

How to Quickly Remove Falsy Values from Lists in Python

One of the most attractive features of Python is its readability and conciseness, allowing developers to write elegant and efficient code. In this article, we will explore a Python method called “Compact” that helps remove falsy values from a list using filter().

The Compact method is a simple yet powerful Python function that removes falsy values (False, None, 0, and “”) from a list. It does this by utilizing the filter() function, which returns an iterator that includes only the elements of the list that satisfy a specific condition.

Continue reading

Understanding False Values in Python: None, “False”, and 0

When working with conditional statements in Python, it’s important to understand what values evaluate to True and what values evaluate to False. While some values are obviously True, such as any non-zero number or a non-empty string, there are a few other values that can sometimes trip up programmers. In particular, the values None, "False", and the number 0 are all examples of values that evaluate to False in Python.

Continue reading

© 2026 Fatos Morina

Theme by Anders NorenUp ↑

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny