Software engineering and personal development

Tag: loop

Unveiling the Versatility of Python’s zip() Function

In the world of Python programming, there’s a versatile function that allows you to weave multiple sequences together, creating a synchronized dance of data. Enter the zip() function, a powerful tool that enables elegant pairing and iteration over multiple iterables. In this brief blog post, we’ll take a closer look at the zip() function and discover how it can simplify your code and expand your programming horizons.

Continue reading

The Pitfalls of Mutating Objects During Iteration in Python


Iteration is a fundamental concept in programming, allowing us to process elements in a collection or iterate over a range of values. However, a common mistake is mutating objects while iterating over them.

Modifying an iterable during iteration can introduce unexpected behavior and yield incorrect results. In this article, we’ll explore the potential pitfalls of mutating objects during iteration and highlight the importance of adopting safer practices to avoid such issues.

Continue reading

How to Quickly Repeat String without Looping in Python

green clothes hanger
Photo by Keagan Henman on Unsplash

You have been doing math calculations since a very young age, from adding two numbers, to multiplying, dividing, and finding the square root of a number by hand.

In Python, you can also multiply a string with a number.

Yes, you read that right. You do not have to do something big, or fancy: You can just take a string and multiply it with any natural number.

You may be wondering, “What’s the result? I know what is 3 * 3, but I don’t know what’s going to be the result of 3 * ‘abc’?

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑