Question 1:
How to make object as callable video __call__
from collections import Counter
class MyCounter(Counter):
Add here required code so that we can give data to object like co1("intel")
co1 = MyCounter()
co1("intel")
from collections import Counter
class MyCounter(Counter):
def __call__(self, data):
print(data)
co1 = MyCounter()
co1("intel")
Comments
Leave a comment