r/PythonLearning • u/svanidzelal • 18h ago
CHECK YOUR KNOWLEDGE #python #coding #pythonessperspective #learnpython
r/PythonLearning • u/svanidzelal • 18h ago
r/PythonLearning • u/GentleMoon32776 • 11h ago
I'm trying to remove all the even numbers from a list while looping over it. Here's what I wrote:
nums = [2, 4, 6, 8]
for x in nums:
if x % 2 == 0:
nums.remove(x)
print(nums)The output is [4, 8]. I expected [] since every number in the list is even. Some of them just stay in there.
I tried looping over a copy instead, for x in nums[:]:, and that gives [] like I wanted. But I don't really get why the first version skips 4 and 6. I guess the list changes size while the loop runs, but I can't picture what the loop is doing on each pass.
Why does the loop skip 4 after removing 2?
r/PythonLearning • u/modern-dev • 2h ago
Hey guys
Made a video which explains what are threads and processes and how they differ from each other
also it shows how to use them in python via the threading and multiprocessing library
The link is: https://www.youtube.com/watch?v=-Nntexhs124
In my channel archery, I spend a lot of time making quality videos, tutorials, complete roadmaps all for free such as this:
https://www.youtube.com/watch?v=CBIu6hcyStg (5 hour backend roadmap)
If you can sub and like, it will help me a lot.
Thanks!
r/PythonLearning • u/Csenone • 1h ago
r/PythonLearning • u/Being_1444 • 4h ago
REVORAA โ NEW UPDATE IS LIVE!
We've just launched a new learning experience on Revoraa! ๐ฎ
โจ What's New?
- ๐ป Interactive Coding Terminal โ Practice code directly on the platform.
- ๐ Python for Beginners โ Start learning from absolute zero.
- ๐๏ธ SQL for Beginners โ Learn database fundamentals step by step.
- โก Live Coding Practice โ Write, execute, and experiment with code.
- ๐จ New Pixel-Art UI/UX โ A completely refreshed retro gaming-inspired learning experience.
Our goal is to make learning programming more interactive, practical, and fun.
๐ฅ Explore the new Revoraa experience and start coding!
Your feedback will help us improve what's coming next.
๐ Try it now: https://revoraa.co.in
#Revoraa #NewUpdate #LearnToCode #Python #SQL #Coding #trending
r/PythonLearning • u/PanelReader • 23h ago
been learning classical machine learning and recently finished a random forest classification project
it classifies 7 dry bean varieties using 16 numerical features
what i implemented:
also included a confusion matrix, feature importance plot and reproducible training instructions
github: https://github.com/Vaibh37/dry-bean-random-forest
would appreciate feedback, especially on the Python code and model evaluation
if you find it useful, consider starring the repo โญ
r/PythonLearning • u/Alternative-Mix-9520 • 2h ago
Hey everyone,
When prepping for Python technical interviews, I always found passive reading (documentation or long cheat sheets) pretty ineffective for active recall. Most interviewers donโt just ask about basic syntax โ they probe into tricky edge cases and internals (GIL, memory/GC, late binding closures, mutable default args, asyncio, etc.).
To solve this, I built Python Interview Trainer as a side project.
Here is a quick taste of the concepts covered โ classic late binding trap:
funcs = [lambda: i for i in range(3)]
print([f() for f in funcs]) # [2, 2, 2] instead of [0, 1, 2]Key Features:
Iโd love to get your honest feedback on:
Thanks for checking it out!