Split a list into chunks
Write a generator that yields chunks of a given size. Step-by-step explanation, colour-coded code and real output.
Online Learning Platform
Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.
Write a generator that yields chunks of a given size. Step-by-step explanation, colour-coded code and real output.
Write a pipeline of generators that reads numbers, keeps the even ones and squares them. Step-by-step explanation, colour-coded code and real output.
Write a generator that yields non-empty, stripped lines from a file. Step-by-step explanation, colour-coded code and real output.
Write an iterator class that returns the characters of a word in reverse. Step-by-step explanation, colour-coded code and real output.
Write a class whose objects can be looped over many times. Step-by-step explanation, colour-coded code and real output.
Write a Python program that sums squares with a generator expression. Step-by-step explanation, colour-coded code and real output.
Write a generator that yields Fibonacci numbers, and take the first 10. Step-by-step explanation, colour-coded code and real output.
Write a generator that yields even numbers up to a limit. Step-by-step explanation, colour-coded code and real output.
Write a generator that counts down from n to 1. Step-by-step explanation, colour-coded code and real output.
Write a Python program that rebuilds a `for` loop using `while`, `iter()` and `next()`. Step-by-step explanation, colour-coded code and real output.
Write a Python program that walks through a list with `iter()` and `next()`. Step-by-step explanation, colour-coded code and real output.
20 Python exception handling programs with solutions: try, except, else, finally, raise, custom exceptions, retries and safe parsing, each explained.
Take free timed mock tests with answers and explanations.