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

Values for keys found in a list

Write a Python program to get the values of dictionary keys that are also in a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Nested dictionary from a list of keys

Write a Python program to nest each item of a dictionary under a key from a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Depth of a nested dictionary

Write a Python program to find the depth of a nested dictionary. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Length of each value

Write a Python program to map each string value to its length. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Values for one key from a list of dicts

Write a Python program to extract the values for a key from a list of dictionaries. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Update list values

Write a Python program to add 10 to every number in the first list and subtract 25 from the second. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Empty every list value

Write a Python program to clear the list values in a dictionary. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Convert string values to numbers

Write a Python program to convert the string values of a dictionary to int or float. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove a dictionary from a list

Write a Python program to remove the 4th dictionary from a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Dict of lists to list of dicts

Write a Python program to split a dictionary of lists into a list of dictionaries. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Group key-value pairs into lists

Write a Python program to group a sequence of (key, value) pairs into a dictionary of lists. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Are all values the same?

Write a Python program to check whether all values in a dictionary are the same. 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.