Fibonacci generator
Write a generator that yields Fibonacci numbers, and take the first 10. 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 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.
Write a Python program showing why specific exceptions must be caught before general ones. Step-by-step explanation, colour-coded code and real output.
Write a Python program that validates several fields and reports every error at once. Step-by-step explanation, colour-coded code and real output.
Write a Python program showing that a `with` block closes a file even when an error happens inside...
Write a Python program that prints the type, message and line of a caught exception. Step-by-step explanation, colour-coded code and real output.
Write a Python program that keeps asking for a number until a valid one is entered. Step-by-step explanation, colour-coded code and real output.
Write a Python program that uses `assert` to check a condition and handles the AssertionError. Step-by-step explanation, colour-coded code and real output.
Take free timed mock tests with answers and explanations.