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

Random bytes with os.urandom()

Write a Python program to get random bytes with `os.urandom()` and turn them into a string. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Folders searched for programs

Write a Python program to list the folders searched for executables with `os.get_exec_path()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

System and Python version

Write a Python program to get operating system and Python version information. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Read command-line arguments

Write a Python program that reads arguments passed on the command line. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Run a system command

Write a Python program to run an operating system command and read its output. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Backup sorted by extension

Write a Python backup program that copies every file into a folder named after its extension. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Remove files of one extension

Write a Python program to remove all files with a specific extension from a folder. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Remove a file

Write a Python program to remove a file at a given path. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Copy a file into 10 nested folders

Write a Python program to copy a file into 10 different nested directories. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Copy files of one extension

Write a Python program to copy only the files with a specific extension. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Copy a file

Write a Python program to copy a file from a source path to a target path. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Count files per extension

Write a Python program to count the files of each extension in a target path. 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.