Your First Program in Google Colab

When you login to Google Colab you see the user interface that looks like this:

Figure: Google Colab User Interface
Figure: Google Colab User Interface

In the above figure, Untitled is name of file. So before starting, click on Untitled to rename it. For this article we rename it to "First Program"

To run your python program, you write code in the cell where you see play icon on the left, like this and click on Play Icon to run your script. Here is the snapshot for our first program in Google Colab:

Figure: First Program Google Colab
Figure: First Program Google Colab

Now you've got an idea about how to run script in Google Colab. Now let's check the version number of different package that are available in the Google Colab.

Type following code and run


import sys
print('Python version: ', sys.version)

import tensorflow as tf
print('Tensorflow version: ', tf.__version__)

import torch
print('Torch version: ', torch.__version__)

Output

Python version:  3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0]
Tensorflow version:  2.2.0-rc3
Torch version:  1.4.0

Note: Version number in your output may differ :)