D
D
dabiankolins12018-10-07 21:09:03
Python
dabiankolins1, 2018-10-07 21:09:03

How to learn OOP in Python?

Hello, I mastered procedural programming, wrote several simple games in python, also solved problems in pychekio, python tutor, got used to the language, mastered the main initial topics:
variables, functions, conditions, collections, loops and more.
probably it is worth moving to OOP at least to learn and try out what it is, can you suggest good books / articles / videos on youtube to understand this topic and it is very IMPORTANT how to apply it, practice, why this is such an important part of modern programming, and also give advice on what do next , i mean after learning oop what is worth trying?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2018-10-08
@OnYourLips

I can give a simple advice - try writing projects in Django (a newbie-friendly framework), making the most of the framework's capabilities.
In particular, django.db: although it is crooked, although it implements Active Record and contradicts SOLID, it will do for a beginner.

E
Eugene Pedya, 2018-10-08
@fpinger

The syntax for OOP is described in almost all modern python textbooks.
Let's study it first. How to write a class. How to instantiate an object and interact with its attributes and methods. Getting used to self.
Next, we more consciously use libraries that use OOP and study SOLID.
Then, for the rest of our lives, we learn to write our own classes, creating suitable abstractions of subject areas.

X
x67, 2018-10-08
@x67

Well, write a game. Step by step. For two players. Network. With action and object classes. Pass these very actions and objects by serialization to json and http requests. Of course, this is not always done, but as a clear example - a very good option.
Django is probably not worth it, since it is still a whole framework that, although it works with classes, has many of its own features. To transfer data, you can use the requests library - fast, simple and convenient. In this case, flask will be better for getting data - again, because of simplicity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question