r/PythonLearning • • 1h ago

Learning Python Feels Easy. Until It Isn’t.

Thumbnail
youtu.be
5 Upvotes

Explore many more ArjanCodes videos.


r/PythonLearning • • 11h ago

I've quit my self paced Python course twice at the same section

17 Upvotes

I’m learning Python for work. I’ve quit twice at the same spot- the exercises where you write your own functions and loop through dictionaries. The lessons make sense, then the exercise is a blank editor and I just sit there. Nobody at work codes, so I can’t ask anyone.

I’m not attached to this course either, I’d totally switch if something else explains functions better. Does jumping back in at the hard part make more sense than restarting a third time?


r/PythonLearning • • 7h ago

Python Friendgroup/Server

6 Upvotes

i'm a 20 year old CS student learning python, I feel like theres many other people like me so I felt like making a community where everyone helps each other would prosper us. My discord is filiph20 if u feel like joining just add me :)


r/PythonLearning • • 4h ago

Help Request Collections cheatsheet

2 Upvotes

Hi guys! Can you share your favorite cheatsheets for collections module? I'm trying to find one with asymptotics, but everything that I can find either doesn't contain them, or has limited set of functions and methods


r/PythonLearning • • 7h ago

Neural Network built from scratch with NumPy

Post image
3 Upvotes

This 👉interactive 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 demo visualizes 1,000 training steps of a neural network learning to solve the XOR problem. Watch how the weights evolve as the network learns.

Use the "Step Into" button to explore the implementation in neural_net.py and see the details of the forward and back-propagation. Follow the mathematics behind the implementation in 📑this PDF.

No PyTorch or TensorFlow — just Python, NumPy and mathematics.

Explore 👉other 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 visualizations.


r/PythonLearning • • 4h ago

Help Request Help needed for schools python learning

1 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


r/PythonLearning • • 11h ago

Help Request Need Help With My Selenium Spotify Playlist Scraper

3 Upvotes

Hello, I am attempting to make a spotify playlist scraper. The html reading and everything else is working correctly but the automatic scrolling is not fully working yet and I am stuck. For some reason when i get to about the 100 song mark, Spotify refuses to load any more songs for me. I have tried waiting it out, scrolling a bit more to hopefully trigger it to load, and adding some fake clicks to try to trigger spotify to load. I dont know why it is doing this because when I manually use page down to scroll on a seperate browser it works perfectly. Here is a video of what is happening, and I have linked my github repo for you guys to take a look at it because I cannot post both a video and an image.

HERE


r/PythonLearning • • 14h ago

Help Request Taking the Certiport Python ITS exam in a few days

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 video, or practice tests that helped you pass? Any last-minute tips on what topics they test heaviest would be super appreciated!


r/PythonLearning • • 1d ago

Showcase My first "authenticator"

Thumbnail
gallery
33 Upvotes

Two months ago I started learning python, but not regularly, and today I made my first mini "authenticator", just because I wanted to understand how JSON works.
I used AI to debug some things, because I started with an authenticator without json saves, then I found out about JSON(and combining them was difficult), but most of it was typed by me. Take a look at my code and share your thoughts on how I used JSON and conditionals.

P.S. I know somethings are pretty basic or not the most secure, but as I said, it's just to understand how JSON and conditionals work in this kind of program.


r/PythonLearning • • 1d ago

Can't lock in

9 Upvotes

I am a 22 year old currently learning python but after learning the basics and trying to build small projects I will forget the basics. Like I get confused, where to apply certain functions...etc. is there any way I can fix that .

Also i can't lock in i eventually get stuck in this instgram or reddit loop for hours

Can you guys give me some advice


r/PythonLearning • • 22h ago

I'm 16 and researching my future career in freelance software development. What should I know?

0 Upvotes

Developers and freelancers, I'd like to hear your thoughts on a business model I'm considering for my future career.

A little context about me:

I'm 16 years old, from Algeria, and I've been learning programming and software development for about a year. I'm still a student, currently building my foundations in programming, working on personal projects, and exploring different areas of software engineering.

My long-term goal is to become a software engineer, develop strong technical skills, and eventually work with international clients remotely.

Recently, I've been considering an alternative to the traditional remote full-time employment model: building a freelance business based on recurring contracts.

The idea would be to combine two types of services:

1. Long-term development contracts

Working with companies on ongoing software development projects, under long-term agreements with recurring monthly payments.

2. Monthly software maintenance contracts

Providing continuous maintenance, bug fixes, updates, improvements, and technical support for clients' existing software in exchange for a fixed monthly fee.

Rather than depending entirely on short-term projects, I'd like to build a stable portfolio of long-term clients and recurring contracts.

I'm not planning to jump into this immediately. I'm researching different career paths early so I can make informed decisions and prepare myself properly.

I'd really appreciate feedback from developers and freelancers with real-world experience:

  • Is this business model sustainable in the long run?
  • How difficult is it to find and retain long-term clients?
  • Are monthly maintenance contracts actually profitable?
  • How do you manage several clients and their different expectations?
  • What are the biggest risks and disadvantages?
  • Would you recommend this model over traditional remote employment?

I'm especially interested in hearing from people who have actually built a freelance business around recurring contracts.

A little more about my current work:

I'm also working on personal programming projects to improve my skills. If you're interested in seeing what I'm currently building, here's my GitHub:

GitHub: https://github.com/AnisBerkani/todo-list-cli.git

I'd also be happy to receive constructive feedback on my projects.

Any advice, personal experiences, or things you wish you had known earlier would be greatly appreciated!


r/PythonLearning • • 1d ago

First time building something like this: a web host for AI agents. Not sure what I'm doing, would love feedback

Post image
1 Upvotes

Hey everyone,
I'm a backend/data engineer, and lately I've been learning about AI agents and MCP. I kept asking Claude for small websites, and the annoying part was always the end: copying the files somewhere to put them online. So I tried to build a fix and called it AgenTack.

The idea is simple: your agent sends the site's files to an API, or calls an MCP tool, and gets back a live link. That's it.
What I've built so far, while learning as I go:

  • A small server where an agent can publish, update or delete a static site
  • An MCP server, so Claude Desktop, Claude Code and other MCP clients can use it
  • An experiment with three agents: one plans the site, one builds it and one reviews it. This part taught me the most, and I'm still not sure I designed it well.
  • Uploaded pages are sandboxed on a separate origin, because I was worried about people hosting bad stuff. I'm honestly not sure I got everything right here.

It's all open source (Python, SQLite, Docker). The host and GitHub repo are in the image.

I don't really know yet if this is useful or just a fun learning project, so I'd really like honest opinions:

  • Would you use something like this, or is Netlify/GitHub Pages already enough?
  • Anything in the code or architecture you'd do differently?
  • If you find a way to break the sandbox, please tell me 🙏

Thanks for reading. Any feedback helps me learn.


r/PythonLearning • • 1d ago

30 Python concept based Interview Questions - Free PDF Doc

Thumbnail
github.com
9 Upvotes

Hi All,

I have consolidated my 30 python interview Q&A series into one PDF Doc and added in my github python repo.

File link : https://github.com/grasspacad07/grassp_python/blob/main/Python_Interview_Guide_30_Questions.pdf

This covers most of the topics asked in beginner to intermediate python interviews. You could expect similar question patterns generally. Keep it handy for quick revision.

Thank you! Happy learning and coding :) All the best !


r/PythonLearning • • 1d ago

Help Request why do i get typeerror 'nonetype' object is not subscriptable

2 Upvotes

i'm doing a small practice exercise where i read a csv of my course scores with the csv module and work out the average for each subject. the numbers came from the printout our teacher pins outside the classroom each term, which i typed into a spreadsheet at home so i'd stop adding them up by hand.

import csv
def average(nums):
    total = 0
    for n in nums:
        total = total + n
    avg = total / len(nums)
    stats = {"avg": avg, "count": len(nums)}

with open("scores.csv") as f:
    reader = csv.reader(f)
    for row in reader:
        subject = row[0]
        scores = [int(x) for x in row[1:]]
        result = average(scores)
        print(subject, result["avg"])

Traceback (most recent call last): File "test.py", line 15, in <module> print(subject, result["avg"]) TypeError: 'NoneType' object is not subscriptable

i printed the intermediate variables and the score list and the running total both look fine, ran the function by itself in a separate file, and read the docs page on defining functions. none of that showed me what was wrong.

am i right that i just left out a return inside the function, or is something else in there broken too? thanks


r/PythonLearning • • 1d ago

An Assignment Reminder

2 Upvotes

Recently made another project again, this time I'll actually use cause I keep forgetting to do my work on time. But basically, it's like Google Calendar and will help automatically remind you of what work is due. It also stores data via JSON files or SQLite, depending on which script you run; more details in the README.

https://github.com/F11Fii/Task-Scheduler

Looking for suggestions on how to improve it as well :3


r/PythonLearning • • 1d ago

Hello everyone, in your opinion, what is the best programming project for someone starting at an intermediate level in Python?

Post image
11 Upvotes

r/PythonLearning • • 1d ago

Help Request Where & how to learn python?

3 Upvotes

I'm new in python I don't know where to start and what to learn I have listened that only 20% of python is necessary my goal is AI & ML.


r/PythonLearning • • 1d ago

I built Pyzzel: A lightweight PostgreSQL ORM for Python with SQLAlchemy-like syntax and performance close to raw Psycopg 3

0 Upvotes

Hi everyone,

I've been building Pyzzel, an open source ORM for PostgreSQL. I wanted something with SQLAlchemy's familiar feel, but simpler and closer to raw psycopg speed.

What it does

  • Active Record style: models own short sessions per operation, so there's no long-lived session to manage
  • Own SQL builder on top of psycopg and psycopg_pool
  • select() returns plain rows and get() returns objects
  • Relations and joins
  • Built-in migrations (generate, apply, status, check for drift, pull from the DB)
  • Base.transaction() shares one connection across models, with nested blocks as savepoints
  • Hidden version column for safe updates, and save() updates only changed columns
  • Core code uses only the standard library, and a plain pip install gets everything

Example

python

users = User.select(User.name, User.age).where(User.id == 1)
user = User.get(1)
with Base.transaction():
user.age = 30
user.save()

Why PostgreSQL only? Focus. Supporting one database well beats supporting five badly.

Status: Early stage, with 250+ tests passing against a real PostgreSQL. Feedback, issues and criticism are very welcome, especially on the API design.

GitHub: https://github.com/himanshubokde21/Pyzzel

PyPI: https://pypi.org/project/Pyzzel/

Happy to answer any questions!


r/PythonLearning • • 2d ago

Showcase Database prototype (python)

Thumbnail
gallery
309 Upvotes

I write my first data base code handling a class record using list tell me how is it..

First two are code and the rest is the output.

Tell me if anything can be improve or added to make this code even more practical.


r/PythonLearning • • 1d ago

Learning Python? Looking for 20 people to try a free personalized Python course

0 Upvotes

Hey everyone!

We’re working on a different approach to learning Python, where the course adapts to what you already know, your learning pace, and the topics you struggle with, instead of making everyone follow the same fixed curriculum.
We’re looking for 20 people who are currently learning Python or want to get started.

The course includes:

  • Structured lessons and practical coding exercises
  • Personalized learning paths based on your existing knowledge
  • Adaptive assessments based on your progress
  • AI-assisted learning support when you get stuck

Participation is completely free, with no payment or purchase required. This is an beginner friendly course.

We’ve developed this course through LearnStride and are genuinely interested in understanding whether this approach makes learning Python easier and more effective.

All we ask in return is honest feedback about your learning experience - what works, what doesn’t, and what could be improved.

If you’re interested, please leave a comment or DM me your email address so we can send you an invitation to access the course.

Thanks!
Posted with moderator permission.


r/PythonLearning • • 2d ago

Removing while iterating over a list

Post image
33 Upvotes

An exercise to help build the right mental model for Python data.

The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.


r/PythonLearning • • 2d ago

School Python vs Modern Python 🤯 | If-Else vs NumPy #Shorts

Thumbnail
youtu.be
0 Upvotes

Interesting python problem


r/PythonLearning • • 3d ago

Help Request Complete beginner here: where should I start learning Python?

32 Upvotes

I want to learn Python but don't know where to start!

Hi everyone. I'm a complete beginner and I want to learn Python, but I'm not sure where to begin. There are so many courses and videos that I feel lost.

Could you recommend a course or a step-by-step path for someone starting from zero? Free cost resources are preferred.

Thanks a lot!


r/PythonLearning • • 2d ago

Beginner struggling with web scraping multiple Wikipedia pages using BeautifulSoup in Spyder

6 Upvotes

Hi everyone!

I'm fairly new to Python and currently learning web scraping using Spyder, BeautifulSoup, and requests.

I've been trying to write a script that extracts data from a Wikipedia table, collects the links from the table, and then visits each link to scrape the corresponding Wikipedia article.

I've managed to get some parts working, but I'm struggling to figure out whether my approach is correct and if there are any mistakes in my code.

I'm particularly unsure about how I'm extracting the links and downloading the individual pages.

I would really appreciate some guidance on how to troubleshoot this or improve my approach.

I'm not looking for someone to write the code for me, just some explanations or pointers so I can understand what I'm doing wrong.

Thanks in advance!

here's the code:

import requests

from bs4 import BeautifulSoup

import os

import time

from urllib.parse import urljoin

import pandas as pd

headers = {

"User-Agent": "AcademyAwardsStudentProject/1.0 (educational research)"

}

resp = requests.get(

"https://en.wikipedia.org/wiki/List_of_Academy_Award%E2%80%93winning_films",

headers=headers,

timeout=30

)

resp.raise_for_status()

soup = BeautifulSoup(resp.text, "html")

table_list = soup.find_all("table")

print(len(table_list))

for index, table_name in enumerate(table_list):

if "Film" in table_name.text:

print(index, table_name)

class_name="wikitable"

table_list = soup.find_all("table", class_=class_name)

#print(len(table_list), *[i.text for i in table_list])

for table in table_list:

if "Film" in table.text and "Nominations" in table.text:

table_data = table

break

table_headers = table_data.find_all("th")

column_headers = []

for header in table_headers:

column_headers.append(header.text.strip())

table_row_data = []

for row in table_data.find_all("tr"):

individual_data = [i.text.strip() for i in row.find_all("td")]

if individual_data:

table_row_data.append(individual_data)

df = pd.DataFrame(table_row_data, columns=column_headers)

df.to_csv("academy_awards.csv", index=False)

#Create a folder for the movies

output_dir = "movies"

if not os.path.exists(output_dir):

os.makedirs(output_dir)

#Find the links to each movie

links = []

for row in table_data.find_all("tr"):

cells = row.find_all("td")

if cells:

link = cells[0].find("a", href=True)

if link:

links.append(urljoin(resp.url, link["href"]))

links = list(dict.fromkeys(links))

print("Number of movie links: ", len(links))

#download each movie's Wikipedia page

for index, url in enumerate(links):

name = url.split("/")[-1]

try:

print("Getting movie: ", name)

response = requests.get(url, headers=headers, timeout=30)

if response.status_code == 200:

with open("movies/" + name + ".html", "w", encoding="utf-8") as f:

f.write(response.text)

else:

print("Failed to download: ", url, response.status_code)

time.sleep(5)

except requests.exceptions.RequestException as e:

print("A network error occured:", e)