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

Rename a folder

Write a Python program to rename a folder with `os.rename()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Change ownership with os.chown()

Write a Python program that changes file ownership with `os.chown()` where the platform supports...

2 min readRead →
Python practice

Change permissions with os.chmod()

Write a Python program to change a file's permissions with `os.chmod()`. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Print every nested file and folder

Write a Python program to print all nested files and folders with `os.walk()`. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Print name, path and type

Write a Python program to print the name, path and type (file or folder) of everything in a folder. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Create files with 10 extensions

Write a Python program to create sample files with 10 different extensions. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Run another Python script

Write a Python program that runs another Python script. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Create a full path with os.makedirs()

Write a Python program to create every folder of a path with `os.makedirs()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

List files with os.scandir()

Write a Python program to scan a folder and print all file names with `os.scandir()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Change the working directory

Write a Python program to change the current working directory. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

File size with os.path.getsize()

Write a Python program to get the size of a file in bytes. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Check read permission

Write a Python program to check read and write permission on a path with `os.access()`. 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.