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

Set an environment variable

Write a Python program to set an environment variable for the current process. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

List environment variables

Write a Python program to get the list of environment variables with `os.environ`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Read an environment variable

Write a Python program to read an environment variable. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Median of a list

Write a Python program to get the median of all the elements of a list. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Dog inherits from Animal

Create `Dog` (inherits `Animal`) with breed and weight, and a method to print all details. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Animal class

Create `Animal` with name and colour and a method to print them. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

ShoppingCart class

Create `ShoppingCart` with items and total cost, and methods to add and remove items and calculate the...

2 min readRead →
Python practice

EBook with open and close

Create `EBook` (inherits `Book`) with file_size and format, and methods to open and close the book. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Book class

Create `Book` with title, author and pages, with getter methods. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Laptop class

Create `Laptop` with brand, model and storage, with methods to start up, shut down and check...

2 min readRead →
Python practice

Phone class

Create `Phone` with brand, model and storage, with methods to call, text and check storage. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

VIPCustomer with credit

Create `VIPCustomer` (inherits `Customer`) with credit_limit and discount_rate, and a method for available...

2 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.