Python 2.7 Tutorial Pt 7

[ad_1]
I will explain the basics of Object Oriented Programming with Python. I cover the following : What is an object, class, private attribute, method and Encapsulation


Posted

in

by

Tags:

Comments

21 responses to “Python 2.7 Tutorial Pt 7”

  1. John Ktejik Avatar

    Why define the main() function? If you execute your code without that 'if __name__' thingy, the code will just execute starting from line one. Exact same behavior.

  2. John Ktejik Avatar

    I never got the point of encapsulation. You're protecting the code from… itself? Please give me a practical example where 'anyone' can change the values of an executing program.

  3. Dexter Morgan Avatar

    Hi Darek , i would like to thank you for your tutorials, you helped me before with android tutorials and now you are doing it again with python, thank you so much, i have a question about OOP in python, what is the equivalent of package (in java ) for python ? for example I want to separate the class file and the file with the main function, how to do that ?

  4. b bec Avatar

    my job is also "forcing" me to watch your videos to get the basics of python 🙂

  5. Achint Jain Avatar

    Hi Derek.. Thanks for awesome tutorials. But I am always confused in "classes", If it is possible could you please give some basics of class. It would be great.

  6. Kamil Serafin Avatar

    The more I watch… the more I know.. how much I do not know.
    Thanks for videos. They are extremely fun.

  7. Lemon Tiger Avatar

    Hi Derek…thank you for getting me past the OOP hump (classes v attributes v instances v methods). Is it possible for you to include your code in its entirety in the description or provide one complete screenview at the end of the video? I had to go back and forth to see all the bits. Thanks again!

  8. John Nthakyo Avatar

    am using python 2.7 for my thesis and cantera so am finding this quite useful

  9. ConsolePeasant92 Avatar

    Why do you type return after every method? I don't really understand that part… Btw. Your tutorials are the best on youtube 🙂

  10. Josh Kirby Avatar

    GREAT TUTORIAL. Thanks for the time you invested. This is better than the 7 week course i just completed.

  11. soumya sarkar Avatar

    best tutorial series in youtube

  12. Jeff van Geete Avatar

    why do some functions (methods :D) have the '__' around them? (eg _init_ and _name_ from vid 6)

  13. Timi Kiss Avatar

    Hey +Derek Banas , thanks for this playlist. Really cool. I am experienced programmer starting with Python. What is the point of the return statement in the set function when it does not return anything? (like a void in other languages)

  14. rafa nadal Avatar

    But Python does not really have true encapsulations as you described. Attribute __owner can still be accessed by calling _className_attributeName. e.g.:

    class Test:
        __x = 10
        
    a = Test
    print a._Test__x

    Python does not really care at the privacy of a variable in the Java (Java is based on the security model) sense. It is more like, well, you see the variable is with double underscore, so if you are sensible enough just don't touch it.

  15. NubPaws Avatar

    Have you found out what school was it?

  16. Homa Taka Avatar

    I got a question. When you're making a class, should you type your code from bottom up concept or top bottom concept?
    And awesome video 😀

  17. Edric Tam Avatar

    thanks a lot Derek!!! Your videos are awesome!!!!

  18. Derek Banas Avatar

    Yes you are correct

  19. Jenia L Avatar

    "self" pretty much equals to "this" in java

  20. Derek Banas Avatar

    Sorry, but I'm not allowed to provide my videos for direct download from YouTube. The reason is complicated. I'd do it if I could, but I just can't. Sorry about that.

  21. Amiree u Avatar

    Is there any way that we can get your videos to get for offline viewing ??

Leave a Reply

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