Real Python

Free Bonus: Click here to download the sample code that you’ll use to explore how Python runs such quick membership tests on range().

Almost there! Complete this form and click the button below to gain instant access:

Why Are Membership Tests So Fast for range() in Python?

Why Are Membership Tests So Fast for range() in Python? (Sample Code)

๐Ÿ”’ No spam. We take your privacy seriously.

ยฉ 2012โ€“2025 Real Python โ‹… Privacy Policy