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

Student inherits from Person

Create a `Student` class that inherits from `Person`, adds student_id and grades, and prints name, age and...

2 min readRead →
Python practice

Person class

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

1 min readRead →
Python practice

Circle area and circumference

Create a `Circle` class with a radius and methods for area and circumference. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Rectangle area class

Write a Python class to calculate the area of a rectangle. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Protected and private members

Write a Python program showing protected (`_x`) and private (`__x`) members. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

setattr() and getattr()

Write a Python program that uses `setattr()` and `getattr()`. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Five-level inheritance chain

Create 5 classes and set up multilevel inheritance among them. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Access five classes through one object

Create 5 classes and access them through a single class object (composition). Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Class in a module, imported elsewhere

Write a Python class in its own module and import it from another script. Step-by-step explanation, colour-coded code and real output.

1 min readRead →
Python practice

Property decorator

Write a Python class that uses `@property` for a validated attribute. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

Employee management system

Write a small employee management system with add, raise and report features. Step-by-step explanation, colour-coded code and real output.

2 min readRead →
Python practice

School management system

Write a small school management system with classes for students and a school. Step-by-step explanation, colour-coded code and real output.

2 min readRead →

Preparing for a QA interview?

Take free timed mock tests with answers and explanations.