- 1
OOP in Python. Âżis this a nice aproach?
I just complete this program trying to learn build classes If someone with some experience in Python could evaluate it (I only have 3-4 months) it will be a great help. Where I can find a list of magic methods / operators? Give me feedback đ€đ€đ€ plzz https://code.sololearn.com/cDHB1EsCh517/?ref=app
3 Answers
0
python
https://realpython.com/
Dan Bader and Real Python are great sites to learn about things in Python
Getting and handling user input is one of the things you have to deal with sooner or later. I can see your struggle to make this work.
đ Your messages are not being displayed properly here in Sololearn. And all inputs have to be given at the input panel in one go. This totally breaks the user experience.đ
Sololearn is very limited when it comes to this input functionality. But I guess it provides a simpler and safer environment. Ok, I am ranting again.
Good work. Knowing OOP is a must have skill.
0
I copy and pasted your code in Pydroid3 on my phone and the console worked ok.
Not sure what the complicated imports are for, when it just seems to give a simple determination of input type.
Abstract classes are way beyond me.
Would be nice if we could know what it is for.
0
Ok, did some reading in :
https://dbader.org/blog/abstract-base-classes-in-JUMP_LINK__&&__python__&&__JUMP_LINK
So ABC makes sure the derived class implements all the methods of the base class. So you have no loopholes in your oop... and possible bugs your program. OOP is a nice concept, but being a complex thing, bugs are inherited when it is introduced in it's implementation.