SQA Tools Blog

Learn testing and automation, one article at a time

Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.

1,901Articles
1,141Solved Python problems
7Topics
100%Free

Latest articles

1,901 articles · page 41 of 159
Python practice

Expand a Counter

Write a Python program to list every item of a Counter as many times as its count. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Layered settings with ChainMap

Write a Python program that looks up settings in command-line, environment and default layers. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

LRU cache with OrderedDict

Write a small least-recently-used cache that holds 2 items. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

namedtuple helpers

Write a Python program using `_asdict`, `_replace` and `_make`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Records with namedtuple

Write a Python program to store employee records as named tuples. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Rotate a deque

Write a Python program to rotate a list of players for a round-robin game. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

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.

1 min readRead →
Python practice

Keep the last N items

Write a Python program that keeps only the 3 most recent log lines. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Stack with deque

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.

1 min readRead →
Python practice

Queue with deque

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.

1 min readRead →
Python practice

Unique values per key

Write a Python program that collects the unique cities each customer ordered from. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Count with defaultdict(int)

Write a Python program to count characters with defaultdict(int). Step-by-step explanation, colour-coded code and real output.

1 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.