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 23 of 95 · Clear filters
Python practice

Common elements

Write a Python program to find the elements common to two sets of words. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Is a set a superset?

Write a Python program to check whether a set is a superset of another. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Symmetric difference in place

Write a Python program to update a set to the symmetric difference with another set. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Union of several sets

Write a Python program to find the union of several sets. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Update a set to its intersection

Write a Python program to keep only the items shared with another set. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

difference() vs –

Write a Python program to find the difference between two sets with the method and the operator. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove an arbitrary element

Write a Python program to remove and return an arbitrary element with `pop()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Clear a set

Write a Python program to remove all elements from a set. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Is a set a subset of any other set?

Write a Python program to check whether a set is a subset of any set in a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Are all elements prime?

Write a Python program to check whether all elements of a set are prime, and list the primes. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Are all elements odd?

Write a Python program to check whether all elements of a set are odd. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Are all elements even?

Write a Python program to check whether all elements of a set are even. 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.