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,677Articles
1,141Solved Python problems
7Topics
100%Free

Python articles

298 articles · page 6 of 25 · Clear filters
Python practice

Exit with a status code

Write a Python program that exits with code 1 on failure and show the code the caller sees. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Sum numbers from the command line

Write a Python program that adds the numbers passed as arguments. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Read command-line arguments

Write a Python program that prints its command-line arguments. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Python Collections Programs with Solutions

20 Python collections programs with solutions: Counter, defaultdict, deque, namedtuple, OrderedDict and ChainMap, each explained with real output.

2 min readRead →
Python practice

Palindrome check with deque

Write a Python program to check palindromes by removing characters from both ends of a deque. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Invert a dictionary with duplicates

Write a Python program to invert a grade dictionary into grade -> students. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Top three scorers

Write a Python program to total player runs from match records and show the top 3. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
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 →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.