Python Features You Should Know

Jordan Williams
The Startup
Published in
8 min readSep 28, 2020

--

That can save you a lot of time !

Using python over the years, I came across some useful features that would have saved me a lot of time if I had known about them a little bit earlier. These little python gems can help keep your code more DRY( Do Not Repeat Yourself) and clean.

By the time you are finished with this article, I can guarantee you that you will be using some of these features in your very own python programs.

Note: You can use any IDE or text editor that you are familiar with ( python’s default IDE is known as “IDLE” and that can also be used). For these features, I will be demonstrating using Visual Studio Code (VS Code) with a python extension.

For maximum appreciation, it would be best if you’ve had some experience in using python. However, even if you have never used python before, this article will help you on your python journey. So sit back, relax and enjoy !

Enumerate

Let’s first start off with Enumerate.

Let’s say you had a list of fruits. You also wanted to loop through all the fruits that are in that list and also keep a track of the position(index) of each fruit in that list using a for-loop.

The following code is an example of this:

--

--

Jordan Williams
The Startup

Enjoys creating software that make tasks simpler. Always trying to gain new knowledge and expertise.