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 practice articles

1,137 articles · page 32 of 95 · Clear filters
Python practice

Swap two tuples

Write a Python program to swap two tuple variables. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Average of a tuple

Write a Python program to calculate the average of a tuple's elements. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Binary tuple to an integer

Write a Python program to convert a tuple of binary digits into an integer. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Count unique tuples

Write a Python program to count the distinct tuples in a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Common tuples ignoring order

Write a Python program to find the tuples that appear in both lists, treating (3, 9) and (9, 3) as the...

1 min readRead →
Python practice

Order tuples by an external list

Write a Python program to order tuples by the order of their keys in another list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Concatenate or nest two tuples

Write a Python program to concatenate two tuples, and to nest them inside one tuple. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Sort by each tuple’s minimum

Write a Python program to sort tuples by their minimum value. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Sort by each tuple’s maximum

Write a Python program to sort tuples by their maximum value, largest first. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove nested tuples

Write a Python program to remove nested tuples from a tuple. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Empty set when nothing is symmetrical

Write a Python program that returns an empty set if no tuples in a list are symmetrical. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Symmetrical tuples

Write a Python program to extract the tuples whose reverse is also in the list. 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.