Learning Python From the Ground Up

The Backstory

I touched Python in school, but honestly? I was too busy juggling the legendary PHP + JS combo to care. Then came my internship (yeah, the one I yapped about here), where I used Python by… squeezing my brain dry, pestering my senior, and begging AI to not gaslight me.

So now I’m back at square one. No shortcuts, no pretending. Just me, Python, and a to-do list app that doesn’t judge.

Starting fresh with Python

Starting fresh with Python - no shortcuts this time

Why Start Over?

Because I wanted to actually understand what I was doing instead of duct-taping code together.

I decided to build the most basic programmer rite-of-passage project: a to-do list manager. Yes, it’s generic. Yes, you’ve seen 1,000 versions of it. And yes, I still did it — because sometimes the “boring” projects teach you the most.

What I Built

A command-line to-do list app that can:

  • Add tasks
  • Show tasks (with numbers, because humans like numbers)
  • Mark tasks as complete
  • Delete tasks
  • Save to a file (so my list actually remembers stuff)
  • Handle user input without crying
The program

Simple, but functional - exactly what I needed

The Concepts That Stuck

1. Functions = sanity.

My first script was 100 lines of chaos. Then I discovered functions. Suddenly, my code wasn't a swamp — it was little islands I could reuse.

Function Structure:

def add_task():
    """Add a new task to the list"""
    task = input("Enter your new task: ")
    if task.strip():
        tasks.append(task.strip())
        print(f"Added: {task}")
    else:
        print("Task cannot be empty!")

2. Lists = storage.

tasks.append() became my favorite thing. Lists taught me how to add, remove, and juggle data without losing my mind.

List Operations:

tasks = []  # Global list to store all tasks
tasks.append(task.strip())  # Add new task
tasks.pop(index)  # Remove task
tasks[index] = "Updated task"  # Modify existing task

3. Humans vs. Python.

Humans count "1, 2, 3." Python says "0, 1, 2." Cue me debugging why Task 3 kept disappearing. Lesson learned: build for humans, not compilers.

Index Conversion:

# User sees task 3, but we need tasks[2]
index = task_num - 1
if 0 <= index < len(tasks):
    return tasks[index]
else:
    print("Invalid task number!")

4. Error handling.

People will type "banana" when asked for a task number. try/except saved me.

Try-Except Block:

try:
    task_num = int(input("Enter task number: "))
    if task_num < 1:
        print("Please enter a positive number!")
except ValueError:
    print("Please enter a valid number!")
except KeyboardInterrupt:
    print("\nGoodbye!")
    exit()

5. Files = memory.

The first time my app remembered tasks after closing? Felt like magic. Suddenly, it wasn't a toy anymore.

File Operations:

def save_tasks():
    with open(TASKS_FILE, 'w') as file:
        for task in tasks:
            file.write(task + '\n')

def load_tasks():
    try:
        with open(TASKS_FILE, 'r') as file:
            return [line.strip() for line in file.readlines()]
    except FileNotFoundError:
        return []  # Return empty list if file doesn't exist

How I Learned

  • Add one feature → test it → break it → fix it → repeat.
  • Predict code behavior before running (spoiler: I was wrong a lot).
  • Break things on purpose to see what happened.
  • Less tutorial bingeing, more hands-on experimenting.

Turns out coding is like cooking: you learn more from burning the first batch than reading recipes forever.

The Struggles (a.k.a. My Facepalm Moments)

Built save_tasks() and then forgot to actually call it. My app had early-onset amnesia.

Overthinking: I planned features I hadn't even written yet. Python humbled me fast.

Realizing programming is 50% writing code, 50% thinking like a confused user.

Task complete

Task complete

What's Next

  • Due dates for tasks (because procrastination needs structure)
  • Categories + priorities
  • Maybe a web version? (hello Flask/Django)

But I'm forcing myself to master the basics first. No jumping into "Machine Learning in 10 Minutes" videos until I can trust my save function.

Code Repository

I'll be sharing the complete code on GitHub once I clean it up a bit. For now, here's a snippet of the main structure:

Main Program Structure:

def main():
    load_tasks()
    while True:
        show_menu()
        choice = input("Enter your choice: ")
        
        if choice == '1':
            add_task()
        elif choice == '2':
            view_tasks()
        elif choice == '3':
            complete_task()
        elif choice == '4':
            delete_task()
        elif choice == '5':
            save_tasks()
            print("Goodbye!")
            break
        else:
            print("Invalid choice. Please try again.")

if __name__ == "__main__":
    main()

Lessons for Fellow Beginners

  1. Build something you would actually use.
  2. Don't add every feature at once — level up slowly.
  3. Debugging sucks, but it's where the learning happens.
  4. Think like your user (even if it's just you at 2 AM).

Wrap-Up

Python from the ground up = humbling, but also fun. Every error, every weird output, every "ohhh that's how lists work" moment — it's all progress.

This is Part 1 of my Python journey. Stay tuned, because the next thing I break (and fix) is probably going here.