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

Reverse values and decorate keys

Write a Python program to reverse each string value and put underscores around each key. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Invert a dictionary with repeated values

Write a Python program to invert a dictionary whose values repeat, collecting keys in lists. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Rename a key

Write a Python program to rename the key "d" to "e". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Delete several keys

Write a Python program to delete a list of keys from a dictionary. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Initialise with default values

Write a Python program to give every name its own copy of a default settings dictionary. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

List of all values

Write a Python program to get a list of all values. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

List of all keys

Write a Python program to get a list of all keys. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Dictionary to a list of tuples

Write a Python program to convert a dictionary to a list of (key, value) tuples. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Keys with a given value

Write a Python program to find all keys that have a given value. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Values of one key from many dicts

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

1 min readRead →
Python practice

Which keys contain each value

Write a Python program to show, for each value, the keys whose lists contain it. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Unique values from list values

Write a Python program to extract the unique values from all list values, sorted. 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.