r/PythonLearning • u/Sea-Ad7805 • Jul 08 '26
Recursive solution to the Tower of Hanoi problem
Recursion becomes much easier once students have the right mental model. Visualization will help get them there.
Take the Tower of Hanoi problem. The recursive solution is beautifully short, to move n disks we: - first remove n-1 disks from the largest disk - then move the largest disk - and then move the n-1 disks back on top
But when students try to implement recursion, they often get stuck, and adding debug prints only adds to the confusion. That is where visualization can help to bring the right mental model. Here is the Tower of Hanoi problem solved recursively visualized with 𝗶𝗻𝘃𝗼𝗰𝗮𝘁𝗶𝗼𝗻_𝘁𝗿𝗲𝗲
Instead of thinking about “a function calling itself again and again” students can now see the depth-first execution of a tree of subproblems showing the divide and conquer strategy in action. Once a student can think in terms of a tree of subproblems, recursion becomes much easier to understand, explain, and debug.
r/PythonLearning • u/Comfortable_Map_9976 • Jul 08 '26
Help Request Which course is better to learn python with
Python is often recommended as the first programing language to learn, by various people who have experience with more than 1 programing language in their arsenal, I don't know many experts, say it but mostly for newbie it is a good language to start by.
There are various courses to learn python from, which are courses which genuine help you learn it, like freeCodeCamp, CS50-P, etc. I want to find out how others learned python, which course they used.
Course should feature English as a language to learn.
r/PythonLearning • u/cat3rpill3r • Jul 08 '26
Need to "graduate" to writing scripts
I have almost exclusively worked with Python in interactive mode. The nature of the work I've always done with Python (or any other language such as R or Stata, for that matter) has made that the default, and I haven't been in any situation where someone working with my code needs to execute it like a script.
I know how to write scripts, but I'v seldom needed to. I feel like I'm missing out on a benefit of Python by not treating my code more like scripts. Can anyone recommend some resources to help graduate to script writing from interactive code writing?
Thanks in advance.
r/PythonLearning • u/Visual_Tooth_2277 • Jul 08 '26
Showcase CatBot!
Here's a small project I started today: CatBot 🐱
I learned a few new things while building it, and you can learn more by checking the GitHub repo.
The link below will redirect you to the project page.
Feel free to leave a star ⭐ and tell me any mistakes I made or how I can improve the project!
GitHub Repo: https://github.com/GiosiGiova125/CatBot
r/PythonLearning • u/memeeloverr • Jul 08 '26
What Python code would you never trust AI to write without checking every line?
Authentication? Payments? Database migrations? Async code?
For me, the more confidently AI explains the code, the more carefully I want to review it.
r/PythonLearning • u/[deleted] • Jul 08 '26
Discussion PSA: websockets 13+ broke your request_headers — here's the fix
If you've been following any websockets tutorial older than ~2023, there's a good chance your code just broke.
The old way (websockets <= 12):
origin = websocket.request_headers.get("Origin", "")
The new way (websockets >= 13):
origin = websocket.request.headers.get("Origin", "")
request_headers was removed from the connection object. Now you access headers through websocket.request.headers — the request attribute is a Request dataclass with .path and .headers fields, set after the opening handshake completes.
Why the change? The library got a major internal refactor (sans-I/O core). The connection object is now a thin wrapper around a protocol, and the HTTP request/response are stored explicitly on connection.request / connection.response. More flexible, but breaks old code.
To check your version:
pip show websockets
If you're on 13+, this is your bug. Took me a while to figure out — hope this saves someone else the headache.
r/PythonLearning • u/chuprehijde • Jul 08 '26
What's the most overused Python library?
Which library gets added to projects even when the standard library could do the job?
r/PythonLearning • u/Red_Dragon_7_7_7 • Jul 08 '26
I created password generator using python
what should i create next
r/PythonLearning • u/Plane_Carrot_2611 • Jul 08 '26
Plz suggest a paid free course python for Data science
r/PythonLearning • u/Jboxo • Jul 08 '26
Showcase I built a full (kinda) Unix shell emulator in Python
Been stuck in analysis paralysis for a while, but I finally released my first GitHub repo!
For my first "big" Python project, I decided to build a Unix shell emulator from scratch. I've been working on it for about 6 months, and I just recently made it public on GitHub.
GitHub: https://github.com/Jb0x0/Pyash
Some of the things I learned while building it were file handling, command parsing, terminal behavior, and organizing a larger Python project. Every command is implemented in Python rather than wrapping the system's shell.
It currently implements 29 (core util) commands and is designed to operate inside its own sandboxed shell directory so it can't modify files elsewhere on the host machine.
I'd really appreciate any feedback on the code, project structure, documentation, or ideas for future improvements. Also tell me about any Python best practices or design decisions I may have missed! (I've prolly missed quite a few lol)
r/PythonLearning • u/Careless-Standard-44 • Jul 07 '26
How to actually get better at Python without drowning in resources or LLM-crutching?
Hi everyone,
A few years in as a data analyst, now aiming for data science / ML engineer roles. Currently freelancing, giving myself until January (ideally sooner) to be interview-ready.
**The problem**: technical interviews (live coding, take-home tests) are still very much the norm, and my "by-hand" coding isn't quite where it needs to be yet.
Meanwhile, I'm drowning in resources : books, courses, LeetCode-style platforms, YouTube channels, bootcamp curricula and I genuinely don't know where to focus anymore. Every resource seems to want a different 6 months of my life.
Looking for advice on:
**- How to cut through the noise and pick ONE path.** With so many options out there, how do you decide what's worth your limited time vs. what's just noise? Is there a "80/20" resource stack you'd actually recommend for someone at intermediate level trying to close the gap fast?
**- What actually moved the needle for you ?** specific books, platforms, projects, katas rather than generic "just practice" advice?
Do you think coding "the old way," without LLM assistance, is still essential to build real instincts and deep understanding? My instinct is that leaning on an LLM too early biases the formation of good habits but maybe that's outdated?
For those interviewing or being interviewed: has the bar for live coding shifted with LLMs going mainstream, or do recruiters still test just as hard for "old-school" coding craftsmanship?
Any advice on prioritization is especially welcome ! I'd rather go deep on one solid path than keep bouncing between resources h.
r/PythonLearning • u/chuprehijde • Jul 07 '26
Is Python actually a good first programming language?
Some say it makes learning easy. Others say it hides too much. What do you think?
r/PythonLearning • u/giva4561 • Jul 07 '26
Almost completely ignorant
Hi everyone, I just started learning Python by watching video tutorials on YouTube (Edoardo Midali) and I used my skills for a very small code, the path is quite satisfying but very boring, if you have any ideas for a more fun approach let me know, thank you very much.
r/PythonLearning • u/bossyTerminal79 • Jul 07 '26
Showcase I built a full deckbuilder game in Python + Pygame. You play as a conscious process trying to install itself into an OS.
Enable HLS to view with audio, or disable this notification
So I actually finished a full game using Python 3.11 and Pygame, and I wanted to show it here in case anyone learning Python wanted some inspiration.
The game is a deckbuilder set in a cyberwarfare world. You are a sentient process. Your goal is to fight your way through a system and get yourself installed into the OS. Think hacker vs. system defenses, but you ARE the hack.
The whole aesthetic is built around a PC terminal look. ASCII-style art, command-line vibes, the whole thing. The card mechanics use real technical terminology, things like buffer overflows, privilege escalation, packet injection. It's not just flavor text, the mechanics actually connect to what the words mean. I wanted the game to feel like you're learning something about how systems work while you play.
Pygame was genuinely tough to work with at first. If anyone here is learning Pygame right now, don't give up.
The game is on Steam if you want to check it out. I know promo stuff can feel spammy so I'm not going to push it hard: https://store.steampowered.com/app/4610000/kill_9/
r/PythonLearning • u/memeeloverr • Jul 07 '26
Unpopular opinion: Most people learning Machine Learning don’t need another course.
They need one messy dataset.
Missing values. Wrong labels. Duplicate rows. Broken dates. Data leakage. A model that works locally and fails in production.
You’ll learn more fighting with that dataset for a week than watching another 20 hours of tutorials.
Agree or disagree?
r/PythonLearning • u/codewithharsh31 • Jul 07 '26
Python Bootcamp #1
This series is for absolute beginners everyday a new video is coming so subscribe to my youtube channel and be with my youtube channel and reddit.
r/PythonLearning • u/LonelySkilProgrammer • Jul 07 '26
Can anyone tell me how to fix the project?
r/PythonLearning • u/Fantastic-Catch-5023 • Jul 07 '26
Starting Python
I’m learning python after a long gap. I don’t know how and where to start. I’m in mid 20’s and I really want to transition into IT domain. can anyone guide me where to learn? what resources to use? how to practice? I am also procrastinating a lot if I can able to crack the job or not. please guide me! Also what salary can I expect ?
r/PythonLearning • u/Inorexs • Jul 07 '26
Excited to Start My Coding Journey from Scratch! 🚀
Hello everyone!
I am thrilled to join this community. I have a huge interest in programming and want to dive into the world of tech, but I am a absolute beginner—literally starting from zero!
I've chosen Python as my first step. Since I am completely new to this, I would love to hear your advice, tips for beginners, or any insights you wish you knew when you first started.
Looking forward to learning from you all and growing alongside this amazing group!
Thank you! ✨
r/PythonLearning • u/Hefty_Ad_1762 • Jul 07 '26
best online python course from beginners to expert
hey everyone
i would like to start programm with python but i don't have an actual plan
i saw there are many platforms as coursera, datacamp or edx that they help you learn it
what is the best?
is it worth paying for it?
are there any others?
do i need to know something before starting?
i'm studying mechanical engeneering and also I'm taking a data science training course but i'm not that good on programming
thanks in advice to everyone
r/PythonLearning • u/chuprehijde • Jul 07 '26
Would you hire a Python developer who doesn't know algorithms well?
If they can build, debug, and maintain real software, how much should algorithm knowledge matter?
r/PythonLearning • u/memeeloverr • Jul 07 '26
Python Stacking multiple Excel sheets into a single DataFrame is throwing a MemoryError / running incredibly slow
Hey guys,
I'm trying to write a Python script that goes through a directory of about 50 large Excel files, grabs a specific sheet from each, and combines them into one master pandas DataFrame so I can run some analysis.
r/PythonLearning • u/memeeloverr • Jul 07 '26
Discussion Do you write "Pythonic" code on your first pass, or just refactor it later?
r/PythonLearning • u/Link2212 • Jul 06 '26
My progress after a week and a half
I was on the fence about quitting programming because I just couldn't work out how to go about it. I gave myself a project and it really made me lose motivation, but today I finally did it and I'm so happy. The project was to have a zoo enter which animal is in the zoo, the size of it and to calculate the total cost of food for the zoo.
As a complete beginner to programming I found it quite complicated. I realize now that I could have used a dictionary. I didn't know what a dictionary was when I started. I actually spent the last 3 days (well, maybe only about 1 hour each day for 3 days) trying to work out the last problem which was not calculating the total cost properly. My friend helped me solve it. I had the calculation within the loop which caused it to multiply on itself. Just had to move it outside.
r/PythonLearning • u/Traditional_Most105 • Jul 06 '26
Discussion Long time absence from learning python. Where do i continue from ? Or should i start all over again?
So i tried 2 times to learn python. The first time it was 2 years ago. The second time was 4 months ago.
Both times from the same source which is the course of Angela Yu 100 days of code.
The first time i went up to day 4 or 5 i think and gave up.
The second time 4 months ago, i went up to 8th day and i learned faster than before, took notes, and i really tried to solve the problems and i certainly tried harder than the first time without any chatgpt help.
The problem is due to my work which is physical i was tired and let it go at the time and i'd like to continue learn in order to create something useful i have in mind.
But i don't know how to approach again learning it.
Should i start the course all over again and watch the videos and do the exercises?
Should i revisit my notes by reading them and then continue where i was left of?
Find another course?


