Skip to content

🐍 Python

Python is a popular programming language created by Guido van Rossum and released in 1991. It's known for its simplicity and versatility.

🌟 General Purpose Language

Python is used for a wide range of applications, including:

  • 🤖 Machine Learning and Artificial Intelligence
  • 📊 Data Science (Data manipulation)
  • 🖥️ Scripting
  • 🔧 Automation
  • 🤖 Robotics
  • 🌐 Websites
  • ...and much more!

💡 Why Python?

  • Cross-Platform: Works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.).
  • Simple Syntax: Has a syntax similar to the English language, making it easy to learn.
  • Concise Code: Allows developers to write programs with fewer lines of code compared to some other programming languages.
  • Interpreted Language: Runs on an interpreter system, meaning code can be executed as soon as it is written. This makes prototyping very quick.

🚀 Beginner Friendly!!

Python's simplicity and readability make it an excellent choice for beginners. Dive in and start coding today!


🐍 Python Installation

For most modern computers, a version of Python should already be installed.

✅ Checking if Python is Already Installed

# 1. Open terminal
python --version
# 1. Open terminal
python -V # If the following results in an error, try
# 2. Type in the following
python3 -V

If Python is not installed, visit this page to download it.

Once the download and installation are complete, please try checking to see if Python is installed.


📝 Introduction to Google Colaboratory

Google Colab is a document that allows you to write, run, and share Python code within your browser. It is built around Project Jupyter code and hosts Jupyter notebooks without requiring any local software installation. Google Colab only supports Python.

✏️ Create a Document

Access Google Colab here. Once loaded, select "File" at the top left corner, then select "New Notebook". If a box pops up upon loading the site, select "New Notebook" to create a new document.

⚙️ Basic Functions

After creating a new notebook, you will see an empty code cell where you can enter Python code and execute it at any time. Execution of code can be done by:

  • Clicking on the play button on the left side of the cell, or
  • Pressing Command/Ctrl + Enter on your keyboard

To generate a new code cell, hover over the top/bottom of your current code cell and click on the "+ Code" button. The "+ Text" button will generate a text cell.

  • Text cells are formatted using a simple markup language called Markdown.

    Shift + Enter will run your current cell and generate a new code cell.

When a cell is selected, a toolbar will appear at the top right corner of the cell. It contains functions specific to the cell, including moving the current cell up or down, adding comments, deleting the cell, etc.

🔄 Sharing Your Colab Notebook

Colab notebooks are stored in Google Drive, and they can be shared just as you would with Google Docs or Sheets. Simply click the Share button at the top right of any Colab notebook.

  • The full contents of your notebook will be shared. You can omit code cell output from being saved or shared by using Edit > Notebook Settings > Omit code cell output when saving this notebook.

📂 Opening a Closed Notebook

In the Colab page, clicking on the logo at the top left of the notebook will show all the notebooks in Drive.

You can also search for notebooks you have used recently using File > Open Notebook.

Now open up Python Tutorial, we will be using this notebook for demonstration and exercises in our workshop.