Web appOpen in Telegram

Post⚡️ Why Is This Loop So Slow?

31 August 2026
P
Python Learning
⚡️ Why Is This Loop So Slow? Imagine you're checking whether thousands of usernames exist. for username in usernames: if username in banned_users: ... If banned_users is a list, Python checks one element at a time. Alice? Bob? Charlie? David? ... For every lookup. Now imagine banned_users is a set. Python doesn't search one by one. It uses a hash table to jump directly to where the value should be. That's why changing this: banned_users = [...] into this: banned_users = {...} can dramatically speed up membership checks without changing the rest of your code.
1 · 640 ·

Nearby in the feed

PPython Learning📖 Reading Python Error Messages Suppose you see this. TypeError: can only concatenate str (not "int") to str Instead of panicking, read it from left to right. TPPython LearningFile
this message
PPython LearningPython Operators ExplainedPPython Learning🐍 Python Type Checking 🔹 What is Type Checking? Type checking is the process of checking the data type of a value or variable. Python provides several ways to d
PPython LearningPython Learning@python_bds · channel · Tech
5 755subscribers537average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog · Search · How we count