Daily Python Puzzle
Read five short snippets, from easy to hard, and predict what each one prints. Every answer comes with a plain explanation, and your streak builds day by day.
How it works
Every day brings five short Python snippets: two easy, two medium and one hard. Read the code, pick what it prints, and see a plain explanation of why. Everyone gets the same five, so you can compare scores with friends or a class.
The puzzles cover the corners of Python that trip people up in interviews and code reviews: mutable default arguments, late-binding closures, integer division, slicing, truthiness, generators and more. Each answer was checked by running the code, and you can open any snippet in the editor and run it yourself.
Your streak and scores are kept in this browser only. No sign-up, nothing to install. Finished early? Practice mode serves more puzzles that do not count toward your streak.