Software engineering and personal development

Tag: sets

How to Quickly Build Your Own Iterators in Python

You have probably had the chance to iterate through a list of elements in one way or another, or through elements of a set, or a dictionary. We can go through a list, a set, or a dictionary and access their elements because they are iterable objects.

An iterator is an object that contains a countable number of objects. This means that you can iterate through elements that an iterator contains.

Continue reading

How to Quickly Check Whether a List Contains Duplicate Elements in Python

white and yellow daisy in bloom
Photo by Stefan Cosma on Unsplash

Sometimes, you may need to check whether a list has any duplicate elements. This can be a common task when you are given a list of numbers or a list of strings. This can also be something that you may need to do both at work, or it can also be part of a coding challenge that you are implementing when being asked at a programming interview.

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑