Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
82cb8f9
Added Makefile
Jiggly-Balls Aug 11, 2026
46f76be
Initialized python-tutorial
Jiggly-Balls Aug 11, 2026
f76e6e6
Merge branch 'main' into feature/python-tutorial
Jiggly-Balls Aug 13, 2026
fec9a39
Finished intro for python tutorial
Jiggly-Balls Aug 17, 2026
c3ad0a3
Added python topic list
Jiggly-Balls Aug 18, 2026
caef292
Added python history
Jiggly-Balls Aug 18, 2026
b9abfb5
Grammar fix - python history
Jiggly-Balls Aug 18, 2026
95d1b76
Added Guido picture
Jiggly-Balls Aug 18, 2026
a4e2085
Linked python history to topic list
Jiggly-Balls Aug 18, 2026
2cfcedf
Updated guido picture filename
Jiggly-Balls Aug 18, 2026
9259c68
Added Introduction to Variables chapter
Jiggly-Balls Aug 18, 2026
db22d51
Added memory diagram for chapter 2
Jiggly-Balls Aug 18, 2026
5e880a0
Added description of memory addresses
Jiggly-Balls Aug 19, 2026
0198899
Fix grammatical errors
Jiggly-Balls Aug 21, 2026
2320634
Rewording
Jiggly-Balls Aug 22, 2026
37543c8
Added data types page
Jiggly-Balls Aug 26, 2026
e5a71f6
Added small introduction to topic page
Jiggly-Balls Aug 26, 2026
0e32af9
Added booleans to data type part 01
Jiggly-Balls Aug 26, 2026
224f791
Added Chapter 4 of Level 1 of Python Tutorial (#11)
kritarth2135 Aug 31, 2026
49ba574
Remade certain sections of built-in-functions-pt-1
Jiggly-Balls Sep 5, 2026
7e7ce82
Rewording
Jiggly-Balls Sep 30, 2026
662e2f3
Fix wording in functions pt 1
Jiggly-Balls Sep 30, 2026
2a373cc
Fix file naming convention
Jiggly-Balls Oct 7, 2026
5938887
Fix link formatting for built-in functions chapter
Jiggly-Balls Oct 7, 2026
92e5599
Fix built in function file name
Jiggly-Balls Oct 9, 2026
e7848bd
Added table for type cast functions
Jiggly-Balls Oct 9, 2026
43fe7f6
Merge branch 'main' into feature/python-tutorial
Jiggly-Balls Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ A Discord community for people who write Python. {{ member_count }} of us so far

[:octicons-arrow-right-24: Read the rules](rules/index.md)




- :material-bug:{ .lg .middle } __Found a mistake on the site?__

---
Expand All @@ -64,5 +61,4 @@ A Discord community for people who write Python. {{ member_count }} of us so far

[:octicons-arrow-right-24: Contribute!](projects/our-projects/this-site.md)


</div>
36 changes: 36 additions & 0 deletions docs/python-tutorial/chapters/01-python-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
description: The very first chapter of the python tutorial. This covers a brief introduction to the history of Python.
---

# Brief Python History

Before we get into learning how to use Python, it would be insightful to know about Python itself.
Why was it created and by whom? Where does Python stand today?

The Python programming language was developed back in the late 1980s by Guido van Rossum in the
Netherlands. It was the successor of the ABC language which was used to teach students in
universities, but it lacked extensibility from being used in real-world programming tasks, which
brings us to Python.

Van Rossum was formerly the Benevolent Dictator for Life (BDFL) of Python, until he stepped down as
the leader on July 12, 2018, after some controversies in the decision-making of adding the walrus
operator ([PEP 572](https://peps.python.org/pep-0572/)) to Python.

The current governance of Python is held by a five-person committee elected by the core developers
called the Python Steering Council. The Python Steering Council is re-elected after every major
release (approximately 18 months). The Steering Council only controls the technical direction of the
Python language.

As of August 2026, according to the TIOBE Community Index, Python is _the_ most popular programming
language in the world, used by millions of developers. Python is a versatile language used in many
domains such as AI/ML, cybersecurity, web development and data science to name a few. In this
tutorial, we will not be covering any of those domains, but instead we will start from the very
basics to build your fundamentals and prepare you to learn them on your own.

<figure markdown="span">

![Image title](/static/python-tutorial/01-guido-portrait.jpg){ width="300" }

<figcaption>Guido van Rossum in 2014</figcaption>

</figure>
102 changes: 102 additions & 0 deletions docs/python-tutorial/chapters/02-intro-to-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
description: Introduction to Python variables.
---

# Introduction to Variables

??? note "Brief on Computer RAM"

In this chapter, we will also be talking about Random Access Memory (RAM) to better understand
variables, but first, let's quickly cover what it is. RAM is where your computer stores the data of
a running program. It is fast, but volatile (wiped when power is lost, unlike disk storage).
Whenever you run your Python program, it loads it into the RAM and the instructions are then fed to
the CPU by your operating system.

Variables give programmers an easy way to work with the computer's memory - they act as a bridge
that lets us use and manipulate memory without dealing with it directly. That is all variables do.
Different languages have different syntax, rules, types of variables, etc., but in the end, they are
all doing the same task. As far as we are concerned, Python does not have multiple types of
variables.

Let's take a look at how we can define a variable in python:

```python
name = "Alan"
```

Let's break this down. Over here, `name` is what we call a variable. `"Alan"` is the data we're
assigning to that variable through the assignment operator (`=`).

!!! note

We will learn more about data types and operators in later chapters. We will be focusing mostly on
variables for now.

So, where does the memory that we discussed before come into play here? When we create a variable in
Python, it automatically reserves some space in memory and places the data there, which the variable
then points to.

<figure markdown="span">

![Image title](/static/python-tutorial/02-memory.png){ width="600" }

<figcaption>
The numbers indicate memory addresses and `~` indicate some random data from other programs,
irrelevant to us. You can imagine memory addresses in a similar concept to your house address.
They both are used to locate the whereabouts.
</figcaption>

</figure>

!!! note

The above image is only an example of how variables point to memory addresses. Note that it is not a
complete representation of how computer memory looks like. Only meant for understanding purposes.

In the diagram above, the variable `name` points to memory addresses `3` - `6`; but notice we never
had to specify that in our code. That's because Python handles this tracking for us automatically.
This is really the whole point of variables: instead of manually keeping track of which data lives
at which memory address, we can just use a variable name as a clear, readable label for that piece
of memory.

Now that we understand why we use variables, we must also know the rules for declaring variables in
Python. There are 4 simple rules which follow:

1. Variables cannot contain any special characters other than underscore (`_`).
1. Variables cannot have spaces in them, use underscores instead.
1. Variables cannot start with a number but can contain numbers inside or at the end of them.
1. Variables cannot share the same names as Python keywords (keywords are reserved words with
special functionality in Python).

!!! note "Case Sensitivity"

Python is a case sensitive language, meaning, in this piece of code:

```python
name = "Zeed"
Name = "Stun"
```

There now exists two variables, `name` and `Name` instead of one. A good rule of thumb is to always
use `snake_casing` convention for your variables which is to keep your variables in all lower cases
and use underscores for word separation.

## Examples

Here is a list of **invalid** python variables:

```python
full name = "James Bond" # Contains a space
age! = 90 # Contains a special character
finally = "yes" # Conflicts with the Python keyword "finally"
20money = 900 # Starts with a number
```

Below is a list of **valid** python variables:

```python
full_name = "Bonding Jameful"
age = 90
answer_1 = "yes"
answer_2 = "no"
```
82 changes: 82 additions & 0 deletions docs/python-tutorial/chapters/03-data-types-pt01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
description: Part 1 of Python Data Types
---

# Data Types Part 01

From our previous chapter, we learned about variables with a small primer on data types. In this
chapter we will understand what they are and how we use them.

## What are data types?

In Python, we can define a data type to be a concrete representation of any value. A value could be
someone's name, money, age, or even a game boss's HP.

## String Data Type

Let's take the example from our previous chapter:

```python
name = "Alan"
```

From here, `"Alan"` is what we call the string data type. It is used to represent textual data
within its quotes (`"`). Python strings can use both double and single quotes, but the opening and
closing quote must match.

Examples of **valid** strings:

```python
country = "New Zealand"
capital = 'Wellington'
```

Examples of **invalid** strings:

```python
language = 'English"
favourite_colour = "Purple'
```

## Integer Data Type

Just like in mathematics, we have an integer data type in Python. An integer is a number that can be
written without a fractional or decimal component.

Example:

```python
age = 34
player_hp = 90
player_hp_max = 100
```

## Floating Point Data Type

Floating Point data type, more commonly called Float, is a data type representing decimal numbers.

Example:

```python
wallet_money_amount = 124.43
bank_money_amount = 33.2
```

## Boolean Data Type

Boolean (or bool) is a special data type in Python. A boolean can only be one of two values: `True`
or `False`.

Example:

```python
is_running = True
is_flying = False
```

!!! warning

`True` and `False` are case sensitive. `true` is **not** the same as `True`.

Booleans are more commonly used in conditional statements, loops and comparison operators which we
will learn in later chapters as a continuation.
Loading
Loading