r/PythonLearning • u/New_Cartoonist337 • Oct 24 '26
Help Request all๐ญโ๏ธ๐ฅ
Wait what f**** nah i dont want sleep okaay
r/PythonLearning • u/New_Cartoonist337 • Oct 24 '26
Wait what f**** nah i dont want sleep okaay
r/PythonLearning • u/Both-Basil1635 • Oct 23 '26
With explicit lazy imports, an imported module can be deferred until the program actually needs it.
Why does that matter?
Many Python applications import dozens โ sometimes hundreds โ of modules during startup, even though only a fraction may be needed for a particular execution path.
Lazy imports can change that:
๐๐บ๐ฝ๐ผ๐ฟ๐ ๐ฑ๐ฒ๐ฐ๐น๐ฎ๐ฟ๐ฒ๐ฑ โ ๐ฎ๐ฝ๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐ฐ๐ผ๐ป๐๐ถ๐ป๐๐ฒ๐ โ ๐บ๐ผ๐ฑ๐๐น๐ฒ ๐น๐ผ๐ฎ๐ฑ๐ฒ๐ฑ ๐ผ๐ป ๐ณ๐ถ๐ฟ๐๐ ๐๐๐ฒ
This can be particularly interesting for CLI tools, large applications, optional functionality and dependency-heavy projects where startup time matters.
Of course, lazy loading isn't automatically better everywhere. Import-time side effects and assumptions about module initialization still matter.
But having lazy imports as an explicit language feature opens up some interesting possibilities for Python application architecture.
๐๐ผ๐ฎ๐ฑ ๐๐ต๐ฎ๐ ๐๐ผ๐ ๐ป๐ฒ๐ฒ๐ฑ. ๐ช๐ต๐ฒ๐ป ๐๐ผ๐ ๐ป๐ฒ๐ฒ๐ฑ ๐ถ๐.
๐ช๐ผ๐๐น๐ฑ ๐๐ผ๐ ๐๐๐ฒ ๐น๐ฎ๐๐ ๐ถ๐บ๐ฝ๐ผ๐ฟ๐๐ ๐ถ๐ป ๐ฝ๐ฟ๐ผ๐ฑ๐๐ฐ๐๐ถ๐ผ๐ป?
r/PythonLearning • u/Both-Basil1635 • Oct 23 '26
Struggling to understand Binary Search? Learn it with Reya in a simple and easy-to-follow way!
In this video, you'll discover how Binary Search works, how it cuts the search space in half with each step, and why it's one of the most important algorithms in Data Structures and Algorithms (DSA).
๐ก What you'll learn:
Perfect for students, coding beginners, and anyone preparing for coding interviews.
r/PythonLearning • u/Many-Bar-5684 • Oct 23 '26
Sharing a resource in case it's useful for your intro classes: https://ubuntu-apps.github.io/code-quest/
I made CodeQuest for my own students as an alternative to the textbook. It covers Python from the basics through functions, files, OOP and working with data. Each lesson has a short explanation, coding challenges that are checked instantly, and a quiz.
The code runs in the browser, so it works on school Chromebooks and phones with nothing to install. It's free, with no ads and no sign-up, and progress is stored on the student's device only.
Happy to answer questions, and feedback is very welcome.
r/PythonLearning • u/inversion2 • Oct 23 '26
Hi guys, just started learning python. Have been stuck on this problem for a while now. Here's my code so far. Could anyone help explain why the code pointed out in blue keeps running even though there is a break in place? Thanks!
ps pls ignore the print("hi") and print("bye"), was using them to test the code!
link to question: https://cs50.harvard.edu/python/psets/3/grocery/
my code so far: https://sharetext.io/3ck00poo

r/PythonLearning • u/Lakus84 • Oct 23 '26
Hello there, i'm a chemistry student and have a course with python. I tried to read a csv file which i downloaded and tried to read it with the np.genfromtxt function but the columns with actual text ( the first and last ) aren't being read, whereas with pandas, the job gets done. I bypassed this problem by specifying the columns but the text keep getting tossed out.. I think it's because of the commas in the compound name but what can i do in this case ? I'm working on jupyter on python 3.13 i believe. Thanks for the help !
r/PythonLearning • u/modern-dev • Oct 23 '26
Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More
The link is:ย https://www.youtube.com/watch?v=CBIu6hcyStg
If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.
r/PythonLearning • u/Ok_Presentation6213 • Oct 23 '26
What's the best resource out there to learn python?
r/PythonLearning • u/autistic_lover214 • Oct 23 '26
I'm stuck in def return in python I don't understand it very well why is it used and how and where does the code return to ? The caller ? What is exactly the caller ?
Thank you so much for helping me
If you don't mind can u help me understand with examples ? Couldn't understand this with Chatgpt and yt
r/PythonLearning • u/Significant-Log-4272 • Oct 23 '26
I've been working on Athena, an open-source tool that analyzes Git diffs and ASTs to detect potential breaking changes before they get merged.
For v1.1.0, I tested it against 55 popular repositories and found some interesting issues:
โข Fixed a C++ performance problem that reduced analysis time from 371 seconds to 7.33 seconds.
โข Reduced false positives from 78 alerts to 8.
โข Fixed Ruby symbol detection and PHP recursion detection.
The final benchmark covered 55 repositories and 10,680 diff hunks with 121 tests passing.
I'm also experimenting with local models through Ollama to generate summaries without replacing the deterministic analysis.
I'd appreciate it if anyone here gave the project a look and shared feedback. I'm especially interested in false positives, edge cases in Python AST analysis and approaches to detecting breaking API changes
โญ If you find the project useful, consider giving it a star on GitHub. It would really help the project reach more developers
GitHub: https://github.com/aaryanrwt/athena
Release notes: https://github.com/aaryanrwt/athena/releases/tag/v1.1.0โ
r/PythonLearning • u/Better-Magician-427 • Oct 22 '26
Hey guys, I tried remaking my project of a cli based football manager simulator this time using the pywebview library (lets you use html css js as a frontend and connect it to a python backend as a desktop app),
So far what I'm struggling with the most being one of my first larger scale project is persistence, keeping one version of the team class across the python scripts and functions.
Im also struggling with figuring out the generation for player stats and attributes, ive landed on the random.gauss for generating player stats with weighing and this ugly ahh looking formula that looked like it was doing something for the player market values.
Also, assets. Do you guys have any place where I can find pictures and icons I can use for free?
Finally, thanks to feedback from helpful people here I tried using sqlite for this project instead of json files, kinda hard to adapt to but im managing.
if any very cool person could help me with my issues I would greatly appreciate it.
Here is the github: https://github.com/mousdieng10-maker/Playstyle-II
r/PythonLearning • u/NoLibrarian2289 • Oct 22 '26
I ran a small experiment that demonstrates something easy to overlook in software testing: an implementation and its tests can both be wrong in the same way.
Consider this discount function:
def calculate_total(subtotal, discount):
if subtotal < 0:
raise ValueError("Subtotal cannot be negative")
if discount < 0:
raise ValueError("Discount cannot be negative")
return subtotal * (1 - discount / 100)Suppose the requirement says discounts must be between 0 and 100, inclusive.
A few happy-path tests pass:
assert calculate_total(100, 10) == 90
assert calculate_total(100, 0) == 100
assert calculate_total(0, 20) == 0But this input exposes the missing validation:
calculate_total(100, 150)
# -50.0The tests pass, but the implementation violates the requirement.
The interesting part isn't just the missing discount <= 100 check. It's that tests can create false confidence when they don't independently cover the contract.
I put together a reproducible Python repository with the flawed implementation, contract tests, property-based testing, and mutation-testing examples.
GitHub experiment:
https://github.com/PranavDixit20/ai-code-test-gap
I also wrote a longer explanation of the problem and the testing techniques here:
https://medium.com/@pranavdixit20/ai-generated-code-can-pass-every-test-and-still-be-wrong-7ddf3177b721
I'm the author of the experiment and article, so this is my own work. I'd be interested in a technical discussion:
When reviewing codeโespecially AI-generated codeโhow do you check that tests verify the actual requirements rather than just confirming the implementation's assumptions?
r/PythonLearning • u/onnatsari • Oct 22 '26
I built DevStart Lab to help beginners figure out what to learn and practice next.
It includes programming fundamentals with Python examples, 25 project ideas, and a step-by-step introduction to Git and GitHub contributions. Itโs free, open source, available in English and Portuguese, and requires no account. Progress is saved in your browser.
Start here: https://brunnojob.github.io/devstart-lab/?lang=en
r/PythonLearning • u/Sea-Ad7805 • Oct 22 '26
Pandas makes working with data look simple. But some of its most powerful features can also produce surprising results. ๐ฒ
For example:โ
Pandas is much more than rows and columns. Understanding its indexing, alignment, selection, and assignment rules can save you from some very subtle bugs. ๐ชณ
๐ This interactive ๐บ๐ฒ๐บ๐ผ๐ฟ๐_๐ด๐ฟ๐ฎ๐ฝ๐ต example explores these concepts and many more, with short explanations for each operation. ๐ฃ Step through the Python code, see what changes, and experiment with your own modifications: ๐ Pandas operations
๐ฌ Which Pandas operation took you the longest to fully understand?
See more ๐บ๐ฒ๐บ๐ผ๐ฟ๐_๐ด๐ฟ๐ฎ๐ฝ๐ต visualizations.
r/PythonLearning • u/Defiant_Meal1898 • Oct 22 '26
Hey everyone!
I'm 14 and currently learning Python, with the goal of becoming an electrical engineer in the future.
I just finished making a small project โ a vending machine + simulated banking system that runs in the terminal. It has account creation, deposits, balance checking, purchases, and local data storage using JSON. I split the code into multiple Python files and made a simple launcher for it.
This is one of my first proper projects, and I know my code probably isn't the cleanest, so I'd genuinely appreciate some feedback!
I'd love suggestions on:
I'm not looking for someone to rewrite the entire project for me โ I'd rather understand my mistakes and learn how to fix them myself.
Here's my GitHub repo: https://github.com/suryansh-devx/python-vending-machine
Thanks! Any constructive criticism or advice is welcome :)
r/PythonLearning
•
u/No-Welder-6636
•
Oct 22 '26
Hey guys i want to start learning python , any suggestions or tips would be appreciated
r/PythonLearning • u/sebalhag • Oct 22 '26
So far we just have Gleb K, who made some code reminiscent of the X Window System 1989,
XPM is an ASCII text-based image format.
https://pyweblib.org/weblog/python-pixel-art-from-text/
Hopefully still in the rules, the site is OPEN SOURCE and Educational
r/PythonLearning • u/AdhesivenessSuch5660 • Oct 21 '26
I worked on a project on building a local image search system in Python using manufacturing inspection photos. You can give it an example image or a text description, then retrieve similar photos from an archive. The project connects a few useful concepts: loading a pretrained model, processing images in batches, storing vectors with metadata, and querying the results.
It uses CLIP ViT-B/32 to generate embeddings and VectorAI DB to store and search them. MVTec AD provides the example dataset.
Hereโs the workflow:
Once the model, dependencies, and dataset are downloaded, the pipeline can run offline.
The Python practice here comes from connecting the stages into a working application: handling files, preparing model inputs, batching inference, and keeping embeddings associated with the correct metadata.
Thereโs also an evaluation challenge. Two images can share the same defect label while showing scratches of different sizes or orientations, so reviewing the actual results is an important part of testing the pipeline.
If you were building this as a learning project, which stage would you want to see broken down into a smaller code example?
r/PythonLearning • u/Stunning_Gur2575 • Oct 21 '26
i have been really confused how do i practice coding problems , how do i start the leetcodes etc.can any
r/PythonLearning • u/Many-Bar-5684 • Oct 21 '26
Sharing a resource in case it's useful for your intro classes: https://ubuntu-apps.github.io/code-quest/
I made CodeQuest for my own students as an alternative to the textbook. It covers Python from the basics through functions, files, OOP and working with data. Each lesson has a short explanation, coding challenges that are checked instantly, and a quiz.
The code runs in the browser, so it works on school Chromebooks and phones with nothing to install. It's free, with no ads and no sign-up, and progress is stored on the student's device only.
Happy to answer questions, and feedback is very welcome.
r/PythonLearning • u/MammothDouble9150 • Oct 21 '26
Many of the image to ASCII converter I have found only use character with no color. I need it for my terminal game project.
r/PythonLearning • u/Grand_Square7804 • Oct 21 '26
Hey everyone,
Over the past few months, I have been building a comprehensive repository of Machine Learning templates and notebook journals. Since it has saved me a ton of time while prototyping, I decided to open-source it for the community today!
This repo is built using Scikit-Learn and covers everything step-by-step:
Who is this for?
Feel free to explore, clone, use it in your projects, or contribute to it! If you find it helpful, please drop a star โญ๏ธ to support the project.
Feedback and contributions are highly welcome!
r/PythonLearning • u/Guy_Foxx614 • Oct 21 '26
Need suggestions for a book or YouTube channel for learning Python for Maths, beginner to advanced.
Thank you.
r/PythonLearning • u/raymate • Oct 20 '26
New to Python and have a lot to learn. Thought starting with an actual goal would be good starting point.
I want to make a scripted that will check a webpage say every hour and ideally look for the words โOut of stockโ and then update me when it says โIn stockโ or if itโs simpler to start with just if a webpage has changed.
I was reading you could make a checksum of the page and check if thatโs changed. Then the page should have updated if it reports a different checksum.
Im not talking about tracking something complex like Amazon site. My local camera store has an item Im waiting to come back in stock and figured this might be a good project to learn and tackle.
Im using a raspberry pi for coding so i need it geared toward running in Python on that. It would be nice for the script to output to a terminal window โstock statusโ or even if possible email me a change happened.
Any suggestions, guides or pointers that someone could direct me to.
Or would you say this is too complex to learn as my first real world project.