What should be a class in Python?

1. You need to keep state. For example, if you need to manage a bunch of students and grades, or when you build a game that keeps track of attempts, score, etc (Hangman example). Basically, when you have data and behavior (= variables and methods) that go together , you would use a class.

Sizin İçin Seçtik  What are the core attributes of Java?

Leave a Reply

Your email address will not be published. Required fields are marked *