Send values into a generator
Write a generator that keeps a running average of values sent to it. 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 keeps a running average of values sent to it. Step-by-step explanation, colour-coded code and real output.
Write a Python program that compares the memory of a list and a generator of a million numbers. Step-by-step explanation, colour-coded code and real output.
Write a Python program that shows zip and enumerate return iterators. Step-by-step explanation, colour-coded code and real output.
Write a Python program that assigns browsers to 7 tests in rotation. Step-by-step explanation, colour-coded code and real output.
Write a generator that produces ids like TC-001, TC-002, . Step-by-step explanation, colour-coded code and real output.
Write a generator that yields the running total of a list. Step-by-step explanation, colour-coded code and real output.
Write a recursive generator that flattens nested lists. Step-by-step explanation, colour-coded code and real output.
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.
Take free timed mock tests with answers and explanations.