Skip to content

Python Field Guide

Get started

Code organization

External files and resources

Add-On Libraries

Data analysis

APIs

FAQ

Why learn to code yourself, if AI can do it for you?
Learn to do it yourself Have AI do it for you
Writing & struggling with code Productive struggle is what builds understanding
  • You can solve the problem again on your own
  • Adapt the answer, and catch when it's wrong
Being handed the answer skips the friction that builds understanding
  • If you skip that struggle, you won't develop the knowledge to solve the problem again, adapt the answer, or recognize when it's wrong.
Reading & verifying code Understanding programming fundamentals makes AI more useful — you can read code you didn't write, and check it before you trust it
  • Spot mistakes
  • Understand why a solution works
  • Communicate your problem to AI more effectively
Inefficient communciation with AI if you don't fully understand what's going on, and AI code can look correct while being wrong and insecure
On the job Employers are still hiring for understanding, not prompting
  • Code review, debugging, and interviews all test whether you can reason about code
  • And judge whether it's correct
  • Learning to program on your own turns AI into a tool you can direct and verify, instead of one you're assuming got it right
AI will likely be available at work too — but it isn't what's being tested

References

How to use AI to support your learning
swimlane-beta TB
    accTitle: Using AI to learn
    accDescr: AI walks you through setup before you start. You attempt each problem yourself with autocomplete off, then check whether you can explain why it works and whether it actually holds up — if either check fails, you describe what you tried rather than handing over your code, so AI explains the concept instead of fixing it, and you try again. Passing both checks means you understand it well enough for a practice problem, or for the code review, debugging, and interviews that are what your job actually tests.

    subgraph You
        you_help_setup(Need help setting up your computer to start programming?)
        you_have_project(Do you have a project to work on?)
        you_attempt(Attempt it yourself, autocomplete off so you understand everything that's there, utilize debug strategies)
        you_writeup(Stuck? Write out your problem: what you expect to happen, what you're observing, what you've tried already, see if this helps you process or rethink your strategy)
        you_finish("Learning to program means making mistakes, getting stuck, and eventually figuring things out and forming a mental model. That's the process that builds skills you can rely on to continue solving problems and detecting issues — ready for code review, debugging, and interviews, where AI won't be tested, your reasoning will. ")
    end

    subgraph AI
        ai_help_setup(AI can help guide you through setup on your exact device — which could make getting started more accessible for beginners)
        ai_suggest_problem(Suggests a problem based on your skill level, interests, and what you're trying to improve)
        explain(With that context AI can provide more targeted, efficient help. Don't just paste the code/error, ask AI to explain what a line does, or what an error means — an explanation to help you understand concepts, be clear you do NOT want it to write code, just explain)
    end


    ai_help_setup ~~~ you_help_setup
    ai_suggest_problem ~~~ you_have_project
    you_help_setup -->|Yes| ai_help_setup
    you_help_setup -->|No| you_have_project
    ai_help_setup --> you_have_project

    you_have_project -->|No| ai_suggest_problem

    you_have_project -->|Yes| you_attempt

    ai_suggest_problem --> you_attempt
    you_attempt <--> you_writeup
    you_attempt -->|Done!| you_finish
    you_writeup --> |still stuck?| explain
    explain --> you_attempt
    explain ~~~ you_finish

    %% Edge label text colored red if it leads into the AI lane, green
    %% if it leads into the You lane, matching the lane colors. This is
    %% linkStyle's "color" property (not background) — the one styling
    %% mechanism mermaid applies from inside its own closed shadow
    %% root, so it's the only thing that actually reaches the label.
    linkStyle 0 color:#a33f3f
    linkStyle 1 color:#3f6b52
    linkStyle 3 color:#3f6b52
    linkStyle 4 color:#a33f3f
    linkStyle 7 color:#3f6b52
    linkStyle 8 color:#a33f3f

    classDef you fill:#3f6b521f,stroke:#3f6b52,stroke-width:2px,color:#3f6b52
    classDef ai fill:#a33f3f1a,stroke:#a33f3f,stroke-width:2px,color:#a33f3f
    class you_writeup,you_help_setup,you_have_project,you_attempt,you_finish you
    class explain,ai_help_setup,ai_suggest_problem ai
    style You fill:#3f6b521f,stroke:#3f6b52,color:#3f6b52
    style AI fill:#a33f3f1a,stroke:#a33f3f,color:#a33f3f

Fig. 1a — when to use AI while learning to program

What is Python, and what is this guide?

Readable, and quick to write. Python is a general-purpose language built for code that's easy to read back later — even by someone who didn't write it. No compiling: write a .py file, run it directly.

  • Shows up everywhere — web backends, data analysis and machine learning, automating repetitive tasks, scientific computing, quick glue scripts. Several of these are covered on this site's Libraries pages.
  • The skills transfer. Variables, conditionals, loops, functions, classes — the fundamentals every language shares — read closer to plain English here, so you spend your effort learning to think like a programmer instead of fighting a stricter syntax. Once solid, those fundamentals carry over to whatever language you pick up next.
  • Often the fastest language to write correct code in — even though it's not the fastest to run — which is why it's such a common first choice for a new project.

This guide. Python Field Guide is a free, in-browser reference — most code blocks are editable and runnable directly on the page.

  • For learners — self-taught, students in an intro course, or anyone who wants one combined reference to work through start to finish, instead of a scattered pile of search results.