Software engineering and personal development

Month: October 2021

How to Check Whether at Least One Value is True in Python

selective focus photography of white petaled flower
Photo by Katherine McCormack on Unsplash

In the previous article, we saw how to check whether all the values in an iterable object are True in Python.

In this article, we are going to see whether there is at least one condition that is satisfied in an iterable object in Python.

Let us suppose that we have the following list:

We want to see whether we have earned more than 4000 in at least 1 month.

Continue reading

How to Find the Second Largest Element in a List in Python

laptop on gray table
Photo by XPS on Unsplash

There are many articles and videos that show you how to find the largest in a list. However, there are not that many articles that show you how to find the second largest element in a list or the second smallest element in a list.

Yes, I also agree that it can be less frequent when you need to find the second largest one, or the second smallest element. The less demand for it in our daily work, the less supply with tutorials on how to do it.

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑