Python guides
Every code block in these guides was run, and the output shown is exactly what it prints.
- Python exercises for beginners, with answers you can runSeven small Python exercises for complete beginners: print, strings, if, loops, lists, dictionaries and functions. Each has a tested answer and what it prints.
- Python practice problems with solutions you can runSix classic Python practice problems: FizzBuzz, palindromes, counting vowels, the most common word, removing duplicates and two-sum. Every solution is tested.
- Learn Python by making a gameHow learning Python by repairing a broken robot works: each concept becomes a game feature, written by you in real Python, and you download the finished game.
- Python interview questions, with answers you can runCommon Python interview questions: reverse a string, find duplicates, anagrams, lists versus tuples, is versus ==, and the mutable default argument trap. Each answer is tested.
- Python for loop vs while loop: when to use eachThe difference between a for loop and a while loop in Python, with tested examples: range, looping over a list, counting with while, break and continue.
- Python lists vs tuples vs setsWhen to use a list, a tuple or a set in Python, with tested examples: order, uniqueness, unpacking and a subset check for a recipe.