You are usually asked to get the largest or smallest element in a list, but it can also be the case that you are asked to also find more than just a single element, namely, a number of elements that are the largest, or the smallest in that list.
Continue readingTag: find
One of the most common ways of finding the first element in a list in Python is using the index 0.
I was recently thinking of coming up with a more creative idea and I figured out another way.
It’s not something that you may have not figured out yourself. It also doesn’t mean that someone doesn’t know it.
Still, there is always someone who may also find it helpful or that hasn’t had the chance to have time to think about it.
Continue reading