Predictive Hacks

A nice way to add an Indicator to a for loop

This is an easy trick to add an indicator to a for loop in python. Instead of just printing an index for each iteration, we can also clear the output.

from IPython.display import clear_output

for i in range(10):
    #your code

and the output will be like this:

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore


Image Captioning with HuggingFace

Image captioning with AI is a fascinating application of artificial intelligence (AI) that involves generating textual descriptions for images automatically.


Intro to Chatbots with HuggingFace

In this tutorial, we will show you how to use the Transformers library from HuggingFace to build chatbot pipelines. Let’s