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

Permutations of a string

Write a Python program to list all permutations of a string with a built-in function. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Join words with hyphens

Write a Python program to split a string and join it with "-". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Space before each capital letter

Write a Python program to insert a space before every capital letter. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Uppercase the second half

Write a Python program to convert the second half of a string to uppercase. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Leap years in a range given as text

Write a Python program to count the leap years in a range given as a string like "1981-2001". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Name from an email address

Write a Python program to extract the name part of an email address (without trailing digits). Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Add two numeric strings

Write a Python program to add two strings as numbers and return a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Split a multi-line string into lines

Write a Python program to split a multi-line string into a list of lines. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Extract numbers as integers

Write a Python program to extract the numbers from a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Similarity of two strings

Write a Python program to measure how similar two strings are. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Remove symbols and capitalise

Write a Python program to remove unwanted characters from a string and capitalise it. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Number of non-empty substrings

Write a Python program to count the non-empty substrings of a string. 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.