r/learnpython • • 9h ago

Learning Python for LLM Calls and Agents

5 Upvotes

I'm a social scientist who has primarily used R for my research, but would like to learn Python so that I can more effectively use LLMs. I completed the Python Programming MOOC, so I'm familiar with basic syntax, classes, etc. I then used Claude to create a textbook with exercises to cover topics such as making API calls, validation, tools, connectors, RAG, automation, eval testing, etc.

The problem I'm facing is that the code in each exercise goes well beyond what I learned in the MOOC, so I'm getting overwhelmed and feel stuck in the weeds. For instance, there are many packages being used that I've never encountered (pydantic, pytest, os, sys, threading, argparse, hashlib, pipeline, __future__) and concepts I haven't encountered (e.g., dataclasses).

- How important is it for me to understand these concepts if I want to use LLMs for scraping, classification, running OCR on large datasets? How much would I be missing if I used codex or Claude Code to simply code the files?

- How would you recommend proceeding? On one hand, I don't want to spend excessive time on more Python tutorials at the expense of doing research, but on the other, I don't want to be missing fundamentals.

- Are there any packages/concepts you would emphasize learning beyond learning basic Python syntax?

- Could you provide resources that provide a more gentle overview of how to use Python for the purpose of using LLMs?

Thanks!


r/learnpython • • 4h ago

how do i learn python(programming)?

0 Upvotes

.


r/learnpython • • 21h ago

Python learning as a beginner

11 Upvotes

Hey I need some help regarding programming python? Where am I supposed to begin? How to embrace the language? People say that you just dive in and you’ll start learning it, I tried but I go stuck, need serious help, please


r/learnpython • • 11h ago

What's the point where learning Python starts to feel less confusing?

3 Upvotes

I've been learning Python and have covered the basics, including variables, loops, conditionals, functions and data structures.

I'm trying to figure out the right way to move forward before getting into libraries like NumPy and Pandas.

For people who have been programming for a while:

  1. What concepts took you the longest to properly understand?
  2. At what point did you stop feeling like you were just memorising syntax?
  3. Would you recommend building small projects before moving into libraries?

I'd rather develop a solid understanding than rush through tutorials.


r/learnpython • • 10h ago

Recommendation for a “cheat sheet” with relevant python syntax

4 Upvotes

Hey all

I have an exam next week in my introductory python course. I have been doing the work, so I am not necessarily scared that I will fail, but I am terrified of making a dumb mistake because I forget basic syntax due to exam anxiety.

Mistakes such as suddenly forgetting how to remove an item from a list, despite having done it hundreds of times.

I have been writing notes myself on all the syntax I have used throughout the course, but I am scared I have missed something crucial.

Is the official python documentation best? I feel it’s a bit complex for an introductory course no?

Thank you in advance, I appreciate any feedback


r/learnpython • • 13h ago

Feeling stuck at "basic-intermediate" — how do you know if you're actually making progress when your code still feels "young"?

5 Upvotes

Hey everyone,

I'm at a point in my Python journey where I'd probably call myself "basic-intermediate," and honestly, I'm having a hard time telling if I'm actually learning or just spinning my wheels.

Whenever I look at my code, it just feels "young." It gets the job done, sure, but it looks very simple and basic compared to what I see other people writing. It makes me doubt whether I'm truly growing as a programmer or if I'm missing something big.

I'm also trying to find new coding friends or a small group around my level so I don't feel like I'm learning in a vacuum.

For those of you who have been through this stage:

  • How did you know you were actually progressing when your code still felt clunky or beginner-level?
  • What helped you bridge the gap from writing "basic" working scripts to writing cleaner, more mature Python?
  • Anyone else at this basic-intermediate stage looking for a coding buddy to share projects and bounce ideas off?

Would really appreciate any advice or perspective. Thanks!


r/learnpython • • 21h ago

Turn these two variables into 1

6 Upvotes

I'm trying to turn these two variables, this is for homework so I'm gonna call it something else. I want to turn people1 and people2 into 1 variable.

people1 has two values, "not green" and "green". people2 has two values as well, "not purple" and "purple".

I want to make it so that everyone with "not green" and "not purple" are combined into one label, but only if they have both, not just one. I am struggling so bad :(

I am using pandas in python also. Thank you.

Edit: I want something like this: https://www.reddit.com/u/blackgarliccookie/s/xkzPCrmyrB


r/learnpython • • 19h ago

Taking the Certiport Python ITS exam in a few day, any recommended YouTube playlists or last-minute tips?

4 Upvotes

Hey everyone, I’m a high school student taking the Certiport (ITS) Python exam in a couple of days, and I need a 700 to pass.
I already have little Python knowledge, so I’m mostly looking for resources tailored to the actual exam format and tricky questions. Are there any specific YouTube videos, or practice tests that helped you pass? Any last-minute tips on what topics they test heaviest would be super appreciated!


r/learnpython • • 8h ago

Help needed for schools python learning

0 Upvotes

so a little of context i have computer science as a subject in grade 12 , and in it i have to study python , sql , stack and python connectivity with sql . i have managed to study sql but im struggling with python all i know is print("hello world") , i dont know if this is the right place to post this but help will be really appreciated . also i cant give it much time sadly coz i have subjects like physics chem and maths hanging in my neck . max i can give is 45 mins a day and i have to do it in under a month .

these are all the topics i need to learn

  • Basics: Tokens, keywords, identifiers, literals, variables, data types, operators, and type conversion.
  • Control Flow: Conditional statements (if, elif, else) and loops (for, while, break, continue).
  • Strings: Indexing, slicing, traversal, and built-in string methods.
  • Lists, Tuples, and Dictionaries: Creation, indexing, slicing, mutability vs. immutability, traversal, and built-in functions/methods.
  • Standard Modules: Importing and using math, random, and statistics.
  1. Functions
  • Types of Functions: Built-in functions, functions defined in modules, and user-defined functions (def).
  • Parameters & Arguments: Positional arguments, default parameters, and keyword (named) arguments.
  • Return Values: Returning single or multiple values (return statement) vs. void functions.
  • Scope of Variables: Global scope vs. local scope and the global keyword.
  1. Exception Handling
  • Error Types: Syntax errors, runtime errors (exceptions), and logical errors.
  • Built-in Exceptions: ZeroDivisionError, TypeError, ValueError, IndexError, KeyError, FileNotFoundError, IOError, etc.
  • Handling Blocks: try, except, else, and finally clauses, along with raise and assert statements.
  1. File Handling
  • File Types: Text files (.txt), binary files (.dat), and CSV files (.csv).
  • General File Operations: open(), close(), with statement, and file access modes (r, r+, w, w+, a, a+, rb, wb, ab, etc.).
  • Text Files: Reading (read(), readline(), readlines()), writing (write(), writelines()), and file pointer manipulation (seek(), tell()).
  • Binary Files: Serialization/deserialization using the pickle module (pickle.dump() and pickle.load()).
  • CSV Files: Reading and writing tabular data using the csv module (csv.reader(), csv.writer(), writerow(), writerows()).
  1. Data Structures (Stack)
  • Stack Concepts: Linear data structure and LIFO (Last-In, First-Out) principle.
  • Stack Operations: Implementation using Python lists (push via append(), pop via pop(), peek/display, and underflow/overflow checks).
  1. Python–Database Connectivity
  • MySQL Interface: Connecting Python to a MySQL database using mysql.connector.
  • Query Execution: connect(), cursor(), execute(), parameterized queries (%s or .format()), commit(), fetchone(), fetchmany(), fetchall(), and rowcount.

THANKS A LOT FOR READING