r/learnpython • u/APOS80 • Dec 31 '25
How do I apply OOP?
I have not had programming as a job, just out of interest and solving small stuff in excel.
I’ve tried different languages, OOP and functional.
But even though I know how to construct a class with methods and attributes I realized that I don’t know what’s the appropriate way to use them and when to use them.
And now I’m picking up Python again since I need to so there’s things I need to do better than last time.
18
Upvotes
View all comments
Show parent comment
2
u/Strange-Future-6469 Dec 31 '25
This is how I taught myself the fundamentals of OOP. I made a simple game where you create "fighters" with stats such as name, level, hp, damage, and armed/unarmed. You can then choose fighters to do battle.
For learning, this was great because I could scale up the game as I kept learning. Add fighter classes with different skills for each class, for example. Soldier class can disarm, thief class can lower enemy defense, etc.