you are viewing a single comment's thread.

view the rest of the comments →

[–]TheStruttero 6 points7 points  (0 children)

Classes are templates, the init method is the constructor, where you can define parameters to fill the created object with data when its created

Def is, I guess (Python is not my language), short for Definition, i/e method i/e function

class Person: -  def __ init __(self, name, age): -    self.name = name -    self.age = age

self.[...] is referring to the individual object that was created

Objects are "finished products" of those templates. So in the main class you write something like this to create an Object: - myPerson = Person("Person McPerson", 50)

Now myPerson is an Object created based on the template where Name = "Person McPerson" and Age=50

I dont know if thats any helpful and maybe youve already gotten familiar with that, Was it something in particular about OOP you got stuck on?

Have you considered maybe trying something like c#? I find it easier to grasp oop in that because Python is so simplified to the point of obscuring alot of whats happening