There is little confusion in the first slide itself. 3rd point reads Abstract classes require subclasses to provide implementations for the abstract methods. 4th point reads Subclasses of an Abstract class are not required to implement abstract methods. Both are opposite things. In 3rd point you are saying it is require to provide implementations but in 4th point, you are saying it is not required to provide implementations. So which is correct?
Usually,abstraction is the hiding the unwanted information and shows the relevant information from the abstract class..where can we implement the relevant information in abstract class
Sir, I really understood the explanation. But can you explain me a real scenario where abstract classes can be used. I mean if if don't wanna use it why would i create an abstract class. And again why would i create a new class and refer to the abstract class? What is the sense? Please explain a real scenario where this would be useful.
in the exapmle of m1 and m2....we are using object (obj=y() y.m1()) but it is not running right.......if we dont use "@abstractmethod" above def m1() and m2.......then it is running......so my quetion is there is no need of abstarction then why we are using it????????
You can describe with ABC your system without concentrating on implementation. It may be more faster to design your app. And next you'll implement real classes and methods by inherit it from ABC you describe before. That stage of development be more faster too, because you have a plan, you know what methods you need. Also you can use `typing` for type annotations to describe type of getting parameters and returning results. Thats may be absolutly unnecessary for smal projects, but if you designing large system it can make life a lot easier. Also in languages with strong typing you can't write good code without abstract classes an interfaces.
Thank you sir. I have a question. How can we use more than one file for one program in Jupyter? like importing functions from another file. Putting classes and function in one file and function calls in another file.
In the last example, we have set instance variable to be a class variable: def __init__(self, value): self.value=value #self.value indicates that variable belongs to class, as a result, instance value turned into class variable. However, at the end we used combination of both CLASS variable (100) along with INSTANCE variables (100, 10): class C(Cal) def add(self): print(self.value+100) #self.value is the CLASS variable and 100 is an INSTANCE variable def sub(self): print(self.value-10). #self.value is the CLASS variable and 10 is an INSTANCE variable cobj=C(100) #100 is the CLASS variable because it was assigned to be so in the constructor method self.value=value cobj.add() cobs.sub() To conclude this, I would say that you are partially right. In the last example, we used INSTANCE variables in conjunction with Class variable.
Super explanation , thank you so much !!
You are welcome!
Have seen many videos abt abstraction … bt this one is the best .. tq so much sir
You are most welcome
There is little confusion in the first slide itself.
3rd point reads Abstract classes require subclasses to provide implementations for the abstract methods.
4th point reads Subclasses of an Abstract class are not required to implement abstract methods.
Both are opposite things. In 3rd point you are saying it is require to provide implementations but in 4th point, you are saying it is not required to provide implementations. So which is correct?
3 rd one
thanks for this video, It cleared my whole doubt for abstract class.
Glad to hear that
Informative video
Thanks
Excellent Mentor.....very experienced....thx for your contribution....
Welcome
Perfect explained
thanks
Awesome explanation sir.....u showed teaching is not but giving clearity to student's....thank you for your contribution sir😍
Welcome
Superb explanation ☺️
Thank you
Usually,abstraction is the hiding the unwanted information and shows the relevant information from the abstract class..where can we implement the relevant information in abstract class
what an explanation Sir Ji, Thank you
You’re welcome
Perfect Video 🤩🥰
Thanks
thank you sir for a clear cut explanation
You are welcome
Sir, I really understood the explanation. But can you explain me a real scenario where abstract classes can be used. I mean if if don't wanna use it why would i create an abstract class. And again why would i create a new class and refer to the abstract class?
What is the sense?
Please explain a real scenario where this would be useful.
Thank you sir.
Most welcome
very good explanation!!! thank you
Welcome
thanks❤❤
Welcome
Thank you Pavan. Helps a lot
Welcome
Thank you
Welcome
❤❤❤❤❤❤❤
in the exapmle of m1 and m2....we are using object (obj=y() y.m1()) but it is not running right.......if we dont use "@abstractmethod" above def m1() and m2.......then it is running......so my quetion is there is no need of abstarction then why we are using it????????
Great explanation with examples. 👌
Thanks
Great!You make it so easy.
Thanks
certainly great explanation, but what we are learning it for? how can we use it ? and why?
You can describe with ABC your system without concentrating on implementation. It may be more faster to design your app. And next you'll implement real classes and methods by inherit it from ABC you describe before. That stage of development be more faster too, because you have a plan, you know what methods you need. Also you can use `typing` for type annotations to describe type of getting parameters and returning results.
Thats may be absolutly unnecessary for smal projects, but if you designing large system it can make life a lot easier.
Also in languages with strong typing you can't write good code without abstract classes an interfaces.
Tq sir
Neat explanation 🙂
You're most welcome
Simple and clear explanation of concept. Towards the end could you mention what you said regarding usage in security?
Superb explanation
Thanks
what is difference between abstract method and abstractclassmethod
Thank you sir. I have a question. How can we use more than one file for one program in Jupyter? like importing functions from another file. Putting classes and function in one file and function calls in another file.
Read about modules in python
Very nicely explained Sir.
Thanks
God bless you! You have made my life easier now.
My pleasure
Very nice video
Thanks
thank you sir :::::::
Most welcome
Nice!
Thanks
Good explanation
Thanks
For more visit: ruclips.net/video/q2RgFH1rPos/видео.html
its not class variable ,,its instance variable
In the last example, we have set instance variable to be a class variable:
def __init__(self, value):
self.value=value #self.value indicates that variable belongs to class, as a result, instance value turned into class variable.
However, at the end we used combination of both CLASS variable (100) along with INSTANCE variables (100, 10):
class C(Cal)
def add(self):
print(self.value+100) #self.value is the CLASS variable and 100 is an INSTANCE variable
def sub(self):
print(self.value-10). #self.value is the CLASS variable and 10 is an INSTANCE variable
cobj=C(100) #100 is the CLASS variable because it was assigned to be so in the constructor method self.value=value
cobj.add()
cobs.sub()
To conclude this, I would say that you are partially right. In the last example, we used INSTANCE variables in conjunction with Class variable.