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

Extract prices

Write a Python program to extract rupee prices like Rs 1,499.50 and add them up. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Find repeated words

Write a Python program to find accidentally repeated words like "the the". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Validate an IPv4 address

Write a Python program to check IPv4 addresses (each part 0-255). Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

camelCase to snake_case

Write a Python program to convert camelCase names to snake_case. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Mask card numbers

Write a Python program to mask all but the last 4 digits of card numbers. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Parse log lines with named groups

Write a Python program to parse "LEVEL date message" log lines into dictionaries. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Match whole words only

Write a Python program to count the word "test" but not "testing" or "latest". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Split on several delimiters

Write a Python program to split text on commas, semicolons and spaces. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove special characters

Write a Python program to remove everything except letters, digits and spaces. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Collapse extra spaces

Write a Python program to replace runs of whitespace with a single space. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Extract URLs

Write a Python program to extract http and https URLs from text. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Extract hashtags and mentions

Write a Python program to extract hashtags and @mentions from a tweet. 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.