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

Extract dates

Write a Python program to extract dates in DD-MM-YYYY format and print them as YYYY-MM-DD. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Extract all numbers

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

1 min readRead →
Python practice

Check a strong password

Write a Python program to check that a password has 8+ characters with upper, lower, digit and...

1 min readRead →
Python practice

Validate PIN codes

Write a Python program to validate 6-digit Indian PIN codes (not starting with 0). Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Validate Indian mobile numbers

Write a Python program to validate 10-digit Indian mobile numbers with an optional +91. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Validate email addresses

Write a Python program to check which strings are valid email addresses. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Current exception info

Write a Python program that reads the active exception with `sys.exception()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Python sys Module Programs with Solutions

20 Python sys module programs with solutions: argv, exit codes, stdin, stdout, stderr, sys.path, version checks and getsizeof, each explained.

3 min readRead →
Python practice

Arguments with argparse

Write a Python program that parses named options with argparse. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Exit with a message

Write a Python program that stops with a message when a required file is missing. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Byte order and encoding

Write a Python program that prints the machine's byte order and the default text encoding. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Which Python is running?

Write a Python program that checks which interpreter file is running. 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.