Learn Python Programming. From Zero Hero

My name is Ziggy wumbua, and I’ll be taking you through this Python tutorial. This course is designed for beginners, and it will take you from having no knowledge of Python all the way to an intermediate level.

For this tutorial, I’ll be using Anaconda because it includes everything we need. You don’t have to install Python separately—Anaconda allows us to use Python within its framework.

To get Anaconda, simply search for “Anaconda download” and make sure you’re on anaconda.com. Click the website, and it will take you to the download page.

Downloading Anaconda can be a bit tricky because you don’t download it directly from the first button you see. Instead, you can follow the procedure provided or, like I did, click Registration, which takes you to another page where all the download options are available.

Here you’ll find download links for all operating systems. I’m using Windows 11, so I’ll download the Windows version. It comes with Python already installed.
For Mac users, select the Mac version; for Linux, choose the Linux version.

I had already downloaded my Anaconda installer, and this is what the downloaded file looks like. I’ll double-click it to launch it.

A pop-up will appear. Click Next, read the license agreement if you wish (I won’t), and then click Agree.
Next, select the installation type. I’ll keep the default, recommended option and continue.

You’ll see a predetermined installation folder, which you can change if you want to organize your files differently. The installation will take up around 5.2 GB of space, which is fine for me.

Continue through the installation steps, leaving the advanced installation options as they are. When the installation completes successfully, click Next until you reach the final page. There are a couple of optional settings; I’ll leave them as they are.

Anaconda will launch and show a welcome screen, which we can close.


Launching Anaconda Navigator

Once Anaconda Navigator opens, you’ll see the landing page. There are several environments for different languages, including RStudio and PyCharm. You can use PyCharm to run Python, but for this course, we’ll be using Jupyter Notebook because it is easy to use—especially within Anaconda.

Click Launch under Jupyter Notebook. This will open a Jupyter Notebook session in your browser. I’m using Microsoft Edge.

Using this approach means you don’t have to install Python or Jupyter Notebook manually—they’re both included in Anaconda.


Introduction to Python

Before creating a file and writing code, let me give you a brief introduction.

Python was created in the early 1990s, and its name comes from the British comedy group Monty Python’s Flying Circus, not the snake. Python is extremely easy to learn, and its syntax reads almost like English.

Python is one of the most popular programming languages today. It’s used for:

  • Web development

  • Machine learning and artificial intelligence

  • Data science and analytics

  • Automation

  • Cybersecurity

  • Many other applications


Getting Started in Jupyter Notebook

To create a new file, go to New → Python 3 (Kernel). This creates a new notebook where you can write and run your code. The file has a default name, but I’ll rename it to session_one.

Each section where you write code is called a cell. When you run a cell, the output appears directly below it.

Jupyter Notebook runs on your local browser, and you’ll see basic layout elements at the top: the file name, menu options like File, Edit, View, Run, Kernel, Settings, and Help.

Here’s a quick walkthrough:

File Menu

  • Create a new notebook, console, terminal, text file, markdown file, or Python file

  • Save, rename, duplicate, reload, and download files

  • Open existing files

Edit Menu

  • Undo and redo actions

  • Cut, copy, and paste cells

  • Keyboard shortcuts like Ctrl+Z for undo

View Menu

  • Show or hide the table of contents

  • Show right sidebar tools such as the debugger

  • Adjust layout elements

Run Menu

  • Run a single cell

  • Run selected cells

  • Run all cells

  • Run only markdown cells

Kernel Menu

  • Interrupt the kernel

  • Restart the kernel

  • Change kernel

The kernel is the Python engine running your code. If your code gets stuck in an endless loop, for example, you can interrupt or restart it from this menu.

Settings

You can switch between light mode and dark mode, change font size, and customize the interface.

Help

This gives access to documentation, keyboard shortcuts, and general information about Jupyter.


Toolbar Icons

The toolbar includes shortcuts to:

  • Save the notebook

  • Insert a cell above or below

  • Cut, copy, paste, and duplicate cells

  • Move cells up or down

  • Run a cell

  • Restart the kernel and run all cells

  • Change cell type (Code or Markdown)


Markdown vs Code Cells

A code cell runs Python code.
A markdown cell is plain text used for headings, explanations, and notes.

Example:
If you set a cell to Markdown and type text, it will not run any Python code.


Google Colab

If you prefer not to run Python on your own device—maybe because of storage or low processing power—you can use Google Colab, which runs Python in the cloud.

Google Colab has an interface very similar to Jupyter Notebook. It automatically saves your work to Google Drive.

The key advantage of Colab is access to powerful hardware, including:

  • GPUs (Graphics Processing Units)

  • TPUs (Tensor Processing Units)

These make Colab ideal for intensive tasks like machine learning.

Colab also gives you temporary cloud storage and shows you how much disk space is available. You can switch between CPU, GPU, and TPU depending on your needs.

Note that GPU resources are limited. If you use them for long periods, Colab may temporarily restrict access until your usage resets. You can avoid this by purchasing compute units.


Back to Jupyter Notebook

Inside Jupyter, you can duplicate cells, move them up or down, insert new cells above or below, and delete cells. These actions are similar to what I demonstrated earlier.

That covers everything you need to know about the Jupyter Notebook layout. After this course, feel free to explore Google Colab for more advanced tasks.


Starting Python Coding

Now let’s dive into actual Python code.

I’ll clear all the existing cells and start with the basics. In any programming language, the first thing we usually do is print output.

We’ll begin with the famous line: Hello, World!

Python syntax is very straightforward—almost like writing English.

Here’s the basic print statement:

print("Hello, World!")

To run the cell, use the keyboard shortcut Shift + Enter.

Anything you write inside the parentheses is what Python prints as output. If you enclose text in quotes, Python treats it as a string.

You can also print numbers:

print(3)

This prints an integer. But if you put the number inside quotes:

print("3")

It prints the number as a string, not an integer. I’ll explain data types later.

The takeaway for now is:
The print() function is how you output information in Python.


 

0% Complete