How to Use Google Colab with Python: Are You Aware of This?

Claudio Sabato
9 min readDec 16, 2022

Google Colab has attracted tremendous attention from developers all around the world. In this tutorial, you will learn the benefit of Colab and how to set up a Colab notebook for Python development.

Let’s write and execute Python code using Colab!

Why Use Google Colab?

A Colab notebook is an interactive environment that enables you to:

  • Execute code
  • Insert images
  • Write Rich Text that supports HTML and LaTeX.

All this in a beginner-friendly environment.

For a lot of ambitious programmers, one great feature Colab provides is free GPU and TPU access.

GPUs (Graphics Processing Units) are frequently utilized to speed up computational algorithms. Examples of fields this applies to are building deep learning models or high-frequency trading.

TPUs (Tensor Processing Units), on the other hand, are designed by Google specifically for accelerating machine learning models.

However, those traits of GPU and TPU also make them very expensive and not easily accessible to many people.

With Colab, you have free access to GPU/TPU up to an allowed limit. This will save you a lot of time in your computations.

Another huge benefit Colab brings to the table is the fact that Colab is a cloud-based notebook. This means it executes and stores your code on remote servers rather than your computer.

In other words, you won’t have to worry about storing large notebooks and data on your computer.

Google Colab also:

  • provides pre-installed libraries so that you will not even need to run the “pip install” command on Colab.
  • lets you link your Google Drive account directly to your notebook. This is a remarkable change in your work style if you frequently work with data.
  • it is compatible with group projects since it allows you to share your notebook in Editor mode. This means that other people who have the link to your notebook can also edit your notebook in place.

How Do You Use Google…

Claudio Sabato

I’m a Software Engineer and Programming Coach. I want to help you in your journey to become a Super Developer!