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 11 of 25 · Clear filters
Python practice

Generator expression of squares

Write a Python program that sums squares with a generator expression. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Fibonacci generator

Write a generator that yields Fibonacci numbers, and take the first 10. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Even numbers generator

Write a generator that yields even numbers up to a limit. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Countdown generator

Write a generator that counts down from n to 1. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

A for loop by hand

Write a Python program that rebuilds a `for` loop using `while`, `iter()` and `next()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Use iter() and next()

Write a Python program that walks through a list with `iter()` and `next()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Exception hierarchy order

Write a Python program showing why specific exceptions must be caught before general ones. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Collect several errors

Write a Python program that validates several fields and reports every error at once. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Clean-up with a context manager

Write a Python program showing that a `with` block closes a file even when an error happens inside...

1 min readRead →
Python practice

Print exception details

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.

1 min readRead →
Python practice

Ask until the input is valid

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.

1 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.