Python's in keyword looks the same everywhere. But its speed varies by orders of magnitude depending on what you're searching. # Slow: O(n) - checks every element allowed_users_list = ["alice", "bob", "charlie", ...] def is_allowed_slow(username): ...
Markdown supported · ⌘↵ to post
No responses yet.