← Back to list

Python Mistakes I Wish I Knew Earlier

If you’re learning Python, let me tell you something.

Shilpita Kuila · 2026-07-27 07:26 · 8 claps · 3.4 min read
#python #coding #programming #python-beginner #data-science
Open on Medium ↗
Wiki topics: ML · Machine Learning EDU · Education & Learning 💻 · Programming 🔬 · Science · General

Python Mistakes I Wish I Knew Earlier

If you’re learning Python, let me tell you something.

Making mistakes is completely normal.

In fact, I believe every Python programmer has looked at their screen at least once and thought,

“Why isn’t this code working?”

I know I have.

When I first started learning Python, I made a lot of small mistakes. Some of them took just a few minutes to fix, while others had me staring at the screen for hours. Looking back, I wish someone had told me about these mistakes earlier.

So, if you’re just starting your Python journey, I hope this blog saves you some time and maybe a little frustration too.

Let’s dive in.

1. Forgetting About Indentation

One of the first things that surprised me was that Python cares about spaces.

Coming from other languages, I thought indentation was just for making code look neat.

Turns out, it’s not.

In Python, indentation is part of the syntax.

For example:

if age >= 18:
    print("Eligible")

If you forget those spaces, Python won’t run your code.

At first, this felt annoying.

But later, I realized that indentation actually makes Python code much easier to read.

Lesson learned: Don’t ignore the spaces. Python certainly won’t.

2. Giving Variables Confusing Names

When I was practicing, my variables looked something like this:

a = 100
b = 25
c = a - b

A week later, I looked at the code again and had no idea what a, b, or c meant.

Now I prefer writing:

total_marks = 100
marks_lost = 25
final_marks = total_marks - marks_lost

The code becomes much easier to understand not only for others but also for your future self.

Remember: Good code isn’t just code that works. It’s code that’s easy to read.

3. Not Reading Error Messages

Whenever I saw a red error message, my first reaction was,

“Something is wrong with Python.”

Most of the time, Python wasn’t the problem.

I was.

Error messages actually tell us what’s wrong.

Maybe you forgot a bracket.

Maybe you misspelled a variable name.

Maybe you tried to divide by zero.

Instead of panicking, take a deep breath and read the error carefully.

Python is often trying to help you.

4. Forgetting to Convert User Input

This is probably one of the most common beginner mistakes.

Suppose you write:

age = input("Enter your age: ")

You might think age is a number.

It isn’t.

The input() function always returns a string.

So if you write:

age + 5

Python will throw an error.

The correct way is:

age = int(input("Enter your age: "))

A small change, but an important one.

5. Writing Everything in One Huge Program

When I started learning Python, I used to write everything in one long file.

Hundreds of lines.

No functions.

No organization.

Finding a mistake felt like searching for a needle in a haystack.

Later, I learned about functions.

Instead of writing everything together, I started breaking my code into smaller parts.

It made my programs easier to read, test, and improve.

Sometimes, solving a big problem starts by breaking it into smaller ones.

6. Copying Code Without Understanding It

Let’s be honest.

We’ve all copied code from the internet at some point.

I definitely have.

The problem is that copied code might work today, but if it breaks tomorrow, you’ll have no idea how to fix it.

Instead of copying blindly, spend a few extra minutes understanding each line.

Ask yourself:

  • Why is this line needed?
  • What will happen if I remove it?
  • Can I write it in my own way?

That’s how real learning happens.

7. Giving Up Too Quickly

This wasn’t really a Python mistake.

It was a learning mistake.

Sometimes I spent an hour trying to fix one small error.

It felt frustrating.

But every bug taught me something new.

Today, when I solve a problem that once seemed impossible, I realize those frustrating moments were actually helping me grow.

Programming isn’t about never making mistakes.

It’s about learning from them.

Final Thoughts

If you’re making these mistakes right now, don’t worry.

Every Python developer from beginners to experienced professionals has been there.

The difference isn’t who makes fewer mistakes.

The difference is who learns from them and keeps going.

So the next time your code throws an error, don’t think of it as failure.

Think of it as Python’s way of teaching you something new.

Because every bug you fix today makes you a better programmer tomorrow.

Happy coding…


메타데이터
post_id
c9a52d528ffb
slug
python-mistakes-i-wish-i-knew-earlier-c9a52d528ffb
url
https://medium.com/@kuilashilpita/python-mistakes-i-wish-i-knew-earlier-c9a52d528ffb
canonical_url
https://medium.com/@kuilashilpita/python-mistakes-i-wish-i-knew-earlier-c9a52d528ffb
author_url
https://medium.com/@kuilashilpita
status
ok
fetched_at
2026-08-23 11:55:00