Moving average with deque
Write a Python program to compute a moving average over a window of 3 values. 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 Python program to compute a moving average over a window of 3 values. Step-by-step explanation, colour-coded code and real output.
Write a Python program that keeps only the 3 most recent log lines. Step-by-step explanation, colour-coded code and real output.
Write a Python program that uses a deque as a last-in, first-out stack. Step-by-step explanation, colour-coded code and real output.
Write a Python program that uses a deque as a first-in, first-out queue. Step-by-step explanation, colour-coded code and real output.
Write a Python program that collects the unique cities each customer ordered from. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count characters with defaultdict(int). Step-by-step explanation, colour-coded code and real output.
Write a Python program to group words by their first letter with defaultdict. Step-by-step explanation, colour-coded code and real output.
Write a Python program that combines two inventories with Counter arithmetic. Step-by-step explanation, colour-coded code and real output.
Write a Python program to check whether two words are anagrams using Counter. Step-by-step explanation, colour-coded code and real output.
Write a Python program to find the 3 most common letters in a word. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count the words in a sentence with Counter. Step-by-step explanation, colour-coded code and real output.
20 Python datetime programs with solutions: format and parse dates, add days, age, weekday, month end, business days, time zones, each explained.
Take free timed mock tests with answers and explanations.