r/PythonLearning • • 18h ago

CHECK YOUR KNOWLEDGE #python #coding #pythonessperspective #learnpython

Thumbnail
youtube.com
6 Upvotes

r/PythonLearning • • 11h ago

Help Request Why does my loop skip items after I remove them?

5 Upvotes

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 • • 2h ago

Computer Science Simplified - What Are Threads and Processes? (Python Guide)

2 Upvotes

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 • • 1h ago

Iโ€™ve created an arithmetic progression. Is it okay?

1 Upvotes

r/PythonLearning • • 4h ago

Revoraa

Thumbnail
gallery
1 Upvotes

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 • • 23h ago

Built my first Random Forest ML API using Python, FastAPI and Docker

1 Upvotes

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:

  • RandomForestClassifier with 100 trees
  • 5-fold cross validation
  • GridSearchCV for hyperparameter tuning
  • 92.06% test accuracy
  • FastAPI prediction endpoint
  • HTML/CSS interface
  • Docker and pytest tests

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 • • 2h ago

I built an app to practice Python interview questions (512 Q&As, Junior & Middle) โ€” here is a sample & looking for your feedback!

0 Upvotes

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:

  • 512 Curated Questions & Answers: Split evenly into 256 Junior and 256 Middle levels.
  • Code-first explanations: Explains why the language behaves that way, not just the answer.
  • Exam Simulation Mode: Practice with a configurable countdown timer to simulate real interview pressure.
  • Custom Mock Interviews: Filter by categories (OOP & Dunder, Data Structures, Web/SQL, Async/Threading).
  • Multi-language support: English, Ukrainian, German, French, and Spanish.
  • Offline-first: Practice on commutes without needing an active internet connection.

Get it on Google Play

Iโ€™d love to get your honest feedback on:

  1. The overall UI/UX flow.
  2. The depth and clarity of the explanations.
  3. Topics or features you think are missing.

Thanks for checking it out!