Sunday, 22 February 2015

Slog # 4: Object-Oriented Programming Concepts


Object-oriented programming in python involves the use of "classes" and "objects. This is a very important topic in computer science.


A Few Concepts: 

It is very important to understand the difference between a method and a function. A function is code that is called by it's name while a method is called by the name associated with object (usually self). "Self" is the basis of the object-oriented programming in python covered thus far.

Other important concepts include understanding the _init_ method. This is a special method which creates a new instance of the class. Another special method is _str_ which creates a printable string representation, while _repr_ creates a string representation that can be evaluated.


Overall, these are a few important concepts to understand in object-oriented programming in python.


Feel free to leave a comment.


Until next time, learn about yourSELF!

No comments:

Post a Comment