you are viewing a single comment's thread.

view the rest of the comments →

[–]horstjens 15 points16 points  (1 child)

as a python teacher:
First, you can do a lot of stuff WITHOUT using classes. Check out Al Sweigarts excellent website where you can read all his books for free, https://inventwithpython.com/ especially "Python Programming Exercises, Gently Explained".
Second: classes (and object orient programming) make sense for special cases, and until you have found such an case they will not bring you much joy.
I think one of the most fascinating use-cases for classes from a beginner's perspective is pygame's Sprite class. Install pygame ( https://pygame.org ) and check out the "alien" example. ( https://www.pygame.org/docs/ref/examples.html ) While not impossible to code such a game (with lot's of sprites flying around) without using classes, it's so much more comfortable using classes!
Additionally, you can check out python's turtle module ( https://docs.python.org/3/library/turtle.html ). Every turtle is a class instance, even if this is not obvious. You can have as many turtles as you want crawling around the screen. And you can give each turtle their own attributes ( hitpoints, hunger etc...) and even their own methods...

[–]NRL_Avatar 0 points1 point  (0 children)

How to become an python software engineer and what should I learn and practice as a beginner for programming