OOP in Python. ¿is this a nice aproach? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 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

1st Sep 2021, 12:10 AM
David Ordás
David Ordás - avatar
3 ответов
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.
1st Sep 2021, 1:01 AM
Bob_Li
Bob_Li - avatar
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.
1st Sep 2021, 8:40 AM
Bob_Li
Bob_Li - avatar
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.
1st Sep 2021, 10:05 AM
Bob_Li
Bob_Li - avatar