In this example which I get from https://www.askpython.com/python/oops/abstraction-in-python I try to understand what's the uses of abstraction but I get a little bit confused
#if i dont import this it will run yet so what's the point
from abc import ABC, abstractmethod
class Absclass(ABC):
def print(self,x):
print("Passed value: ", x)
#even in here if I delete whole this block it don't make any difference
@abstractmethod
def task(self):
print("We are inside Absclass task")
class test_class(Absclass):
def task(self):
print("We are inside test_class task")
class example_class(Absclass):
def task(self):
print("We are inside example_class task")
test_obj = test_class()
test_obj.task()
test_obj.print(100)
example_obj = example_class()
example_obj.task()
example_obj.print(200)
And How Can I access this?
print("We are inside Absclass task"))