Class variables
Write a Python class with a class variable shared by all objects. Step-by-step explanation, colour-coded code and real output.
Online Learning Platform
Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.
Write a Python class with a class variable shared by all objects. Step-by-step explanation, colour-coded code and real output.
Write a Python class with an instance method that uses the object's data. Step-by-step explanation, colour-coded code and real output.
Write a Python class with instance variables and show that each object has its own values. Step-by-step explanation, colour-coded code and real output.
Write a Python class with a constructor (`__init__`) that sets the object's attributes. Step-by-step explanation, colour-coded code and real output.
48 Python OOP exercises with solutions: classes, constructors, inheritance, overriding, abstract classes, encapsulation, properties and real-world classes.
Write a Python program to find the cartesian product of two sets. Step-by-step explanation, colour-coded code and real output.
Write a Python program to find the longest word in a set. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create two sets of books and find the books in both. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create a set of favourite movies and add one more. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create a set of your favourite actors. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create a set of odd numbers from 1 to 20. Step-by-step explanation, colour-coded code and real output.
Write a Python program to create a set of even numbers from 1 to 20. Step-by-step explanation, colour-coded code and real output.
Take free timed mock tests with answers and explanations.