What does this print?
print(0.1 + 0.2 == 0.3)
What this Python test measures, in short
This test checks whether you can predict what real Python code does: how values, names, collections, functions and objects behave at run time. It rewards knowing the language's rules over remembering library names.
Every snippet runs as shown on Python 3.10 or later. The questions are our own and are not standardised against a population, so treat the result as a check on your knowledge, not a certification.
By What's Your IQ · Reviewed 4 Oct 2026- Format
- 15 predict-the-output questions, 4 options each
- Topics
- Types, collections, functions and scope, flow and comprehensions, objects and iterators
- Version
- Python 3.10+ (Python 2 reached end of life on 1 Jan 2020)
- Language
- Created by Guido van Rossum; first public release February 1991
Variables are labels, not boxes
In Python, b = a doesn't copy anything. It puts a second label on the same object. Step through the five lines and watch which object each name points to.
Same result, written the way Python intends
names = ["Ada", "Alan", "Grace"]for i in range(len(names)): print(i, names[i])
names = ["Ada", "Alan", "Grace"]for i, name in enumerate(names): print(i, name)
enumerate hands you the index and the item together, so there's no indexing to get wrong and the loop works on any iterable, not just lists.
- GitHub. (2024). Octoverse 2024: AI leads Python to top language as the number of global developers surges.
- Python Software Foundation. History and License. Python documentation.
- Python Software Foundation. (2020). Sunsetting Python 2.
- TIOBE Software. TIOBE Programming Community Index.
- Stack Overflow. (2024). 2024 Developer Survey: Technology.