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

Handle invalid integer input

Write a Python program that converts text to an integer and reports invalid values. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Handle division by zero

Write a Python program that divides two numbers and prints a friendly message when the divisor is...

1 min readRead →
Python practice

Handle a missing dictionary key

Write a Python program that reads a key from a dictionary and handles a missing key. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Platform information

Write a Python program to print platform details. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

File details with os.stat()

Write a Python program to show the details of a file with `os.stat()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Is a path a symbolic link?

Write a Python program to check whether a path is a symbolic link. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Does a path exist?

Write a Python program to check whether a path exists. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Last modified time of a file

Write a Python program to get the last modified time of a file. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Creation (change) time of a file

Write a Python program to get the ctime of a file with `os.path.getctime()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Split a path

Write a Python program to split a path into folder and file name. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Number of CPUs

Write a Python program to get the number of CPUs with `os.cpu_count()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Change root with os.chroot()

Write a Python program that uses `os.chroot()` where available. 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.