ESEN← Back to the blog
Python

Learning Python from scratch: errors, loops and concepts that are difficult at first

By Guille Ferveg· July 2026· 5 min read

When I started learning Python, it felt as though everyone understood it except me. This is not a perfect tutorial; it is my log of the concepts that were difficult at first and how I eventually understood them without memorizing everything at once.

If you are just starting, I want to tell you one thing first: getting stuck is part of the process, not a sign that you are “not cut out for this.” It happened to me with concepts that now seem obvious. These are the four that confused me most and the simple way I eventually made sense of them.

01 Variables are not magic boxes

At first I thought a variable “stored something forever.” In reality, it is simply a name that points to a value, and you can change that value whenever you want.

name = "Guille"
age = 24
age = age + 1   # age is now 25
print(name, age)   # Guille 25

The idea that unlocked it for me: the = sign does not mean “is equal to”; it means “store this here”. That is why age = age + 1 is not a contradiction: it takes the previous value, adds one and stores it again.

02 Lists and the famous “starts at zero”

A list is an ordered row of items. What confused me most was that the first item is number zero, not one.

fruits = ["apple", "pear", "kiwi"]
print(fruits[0])   # apple (the first)
print(fruits[2])   # kiwi (the third)

fruits.append("grape")   # add to the end
The mistake I repeated countless times: requesting fruits[3] when the list has three elements (0, 1 and 2). That raises an IndexError. Mental trick: when there are three items, the final index is 3 − 1 = 2.

03 The for loop: repeat without copying and pasting

I used to copy and paste lines to do something repeatedly. A for does exactly that in an organized way: it walks through a list and performs the same action for each item.

for fruit in fruits:
    print("I like", fruit)

# If I need numbers, I use range:
for i in range(3):
    print(i)   # prints 0, 1, 2

Be careful with range(3): it returns 0, 1 and 2 (three numbers); it does not reach three. It is the same “starts at zero” logic, and once I connected it with lists, everything clicked.

04 if / else: teaching the program to make decisions

Conditionals are how a program makes decisions. The difficult part was not the idea, but two syntax details.

age = 18

if age >= 18:
    print("Access granted")
elif age >= 13:
    print("Permission required")
else:
    print("Not yet")

05 The errors that scared me—and why they are your friends

At first, every red error message made my heart jump. Then I understood that the error is telling you exactly where and what went wrong. These are the three I saw most often as a beginner:

What helped me most: read the last line of the error first. That is usually where the summary appears. The rest is the path the program followed before it crashed.

What I would tell the Guille who was just starting

Do not try to memorize everything at once. Programming is not learned by memorization; it is learned by using it and making mistakes. Write code even when it is ugly, break it, read the error and fix it. Every bug you understand becomes a concept you will not forget.

These four concepts—variables, lists, for and conditionals—make up something like 80% of what you will use every day. Once you become comfortable with them, the rest starts to follow.

PythonFundamentalsLearningProgramming

Was this useful, or do you have questions?

Write to me and let’s talk—about data, web, audio or code that refuses to compile.

Let’s talk →