Tag: ChatGPT

  • Five numbers and a friendly snake

    Five numbers and a friendly snake

    For many years I’ve described myself as ‘geek-adjacent’. I know lots of people who can do amazing things with code, which means I’ve never had to learn the finer details myself.

    Don’t get me wrong, I know a lot more than most people about HTML, CSS, PHP, systems architecture and whatnot. But then most people don’t know anything about any of that, so it’s not a high bar.

    Anyway, I’ve decided it’s probably about time to partially rectify the situation.

    I’m not planning on becoming a full-stack developer anytime soon, but I have started learning Python.

    Snake charming for fun and profit

    I picked Python because I can use it to set up repeatable processes to help me in my work. That should mean I spend less time worrying about my unreliable memory (yay ADHD).

    The eventual goal is to use Python for practical information processing: inspecting content, finding patterns, working with structured data, improving workflows, and automating things that are actually worth automating.

    Obviously the sensible thing to do would be to get a recommendation for a good course. But sensible isn’t my style, so I’m getting ChatGPT to write me a custom course instead.

    It’s got a proposed syllabus, a progress record, and a custom reference document to contain all the things I have used and understood. Progress will be measured by whether I can explain what the code is doing and demonstrate that I can construct, test, and fix it – not simply by whether I’ve completed a lesson.

    My bots can be mean

    I’ve done my best to train my bots to cut out the flattery and be blunt with me when I’m going off track (Claude regularly tells me to stop pissing around with side projects and get back to what I’m supposed to be doing – which may well be why I’m not using Claude for this project), so hopefully it’s not going to treat me like a 19th-Century dilettante Russian count and give me a passing grade by default.

    The current plan for the course is to move through six phases:

    1. processing fundamentals
    2. structured information, including dictionaries, JSON, and CSV
    3. real files and sources
    4. reliable workflows
    5. content transformation
    6. producing credible evidence of what I can do

    Each learning cycle begins with a problem. To start with, ChatGPT will give me an input, a set of rules, and an intended result. I’ll then attempt to translate them into Python, and ask for help when I get stuck. I’ll also say things like “hey Chat, remind me what the difference is between a function and a method” more times than a human teacher would appreciate.

    Starting small

    I’ve just finished Lesson One. ChatGPT gave me a small data set representing the word counts of five webpages:

    word_counts = [420, 180, 760, 95, 310]

    Then it set me the task of counting the number of pages, adding their word counts together, and working out how many pages had more than 300 words on them.

    So now I know how to use .append(), len(), sum(), and write f-strings – and can make Python count five numbers in several different ways.

    This is a very small achievement, but yesterday I couldn’t do it, and today I can.

    Yay me.

    More to the point, when faced with a blank file I can now write that tiny basic bit of Python from scratch, and can already think of different things I could do with it. Because Python is a little bit like Lego – you have small pieces which do small things (like store a value or add something to a list), and you can connect them together to build bigger, more complicated things – things which didn’t exist before.

    That sounds useful.

    Next lesson: dictionaries and page records.