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

Longest all-capital word

Write a Python program to find the longest word written in capital letters. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove unwanted characters

Write a Python program to remove every character that is not a letter or digit. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove duplicate words

Write a Python program to remove duplicate words (ignoring case) and keep the first occurrence. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Build a sentence from a list of words

Write a Python program to create a string from a list of words. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Palindrome words in a string

Write a Python program to get all palindrome words from a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Replace Java with Python, any case

Write a Python program to replace the word "Java" (in any letter case) with "Python". Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Extract all numbers from a string

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

2 min readRead →
Python practice

Reverse the order of words

Write a Python program to rearrange a sentence so its words appear in reverse order. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Vowel count of each word

Write a Python program to count the vowels in each word and show the result as a dictionary. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Swap first and last letters of each word

Write a Python program to exchange the first and last characters of every word in a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Swap the first and last characters

Write a Python program to swap the first and last characters of a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

String length with a loop

Write a Python program to calculate the length of a string with a loop instead of `len()`. 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.