WP Tutorials

Object Oriented Programming with Python – Full Course for Beginners

Object Oriented Programming with Python – Full Course for Beginners

Object Oriented Programming with Python – Full Course for Beginners



Object Oriented Programming is an important concept in software development. In this complete tutorial, you will learn all about OOP and how to implement it using Python.

💻 Code: https://github.com/jimdevops19/PythonOOP

🔗 Tutorial referenced for a deeper explanation about __repr__: https://www.youtube.com/watch?v=FIaPZXaePhw

✏️ Course developed by Jim from JimShapedCoding. Check out his channel: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg

⭐️ Course Contents ⭐️
⌨️ (0:00:00) Getting Started with Classes
⌨️ (0:12:11) Constructor, __init__
⌨️ (0:50:35) Class vs Static Methods
⌨️ (1:13:22) Inheritance
⌨️ (1:30:14) Getters and Setters
⌨️ (1:51:00) OOP Principles

🎉 Thanks to our Champion and Sponsor supporters:
👾 Wong Voon jinq
👾 hexploitation
👾 Katia Moran
👾 BlckPhantom
👾 Nick Raker
👾 Otis Morgan
👾 DeezMaster
👾 AppWrite

Learn to code for free and get a developer job: https://www.freecodecamp.org

Read hundreds of articles on programming: https://freecodecamp.org/news

source

Comments (50)

  1. Thanks a lot for posting this, FCC! ❤️

  2. The way you explain is great!. I understood several things that struggled with before.

  3. Thank you for sharing. Best tutorial that I have ever seen on Python Object Oriented Programming.

  4. this help a lot

  5. Epic.

  6. Thank you!

  7. Thank you! this helped me a lot!!

  8. can someone tell what is this THEME ?

  9. this is great

  10. The best Tutorial video I have seen till date for Python Programming

  11. Please rename the video title, it is very misleading. This maybe a good course for people who already know OOP to refresh their concepts and understand them better but is absolutely not for beginners. There is no clear guidance on why anything is being done, there is neither flow nor structure, just adhoc command giving and typing. As a true beginner in OOP, not once was it clarified why this is needed (in python for eg) to begin with, rather than write out flat code.

    As this was an assigned video for a course, I had to unfortunately drag myself through it. But everything I learned about OOP, i got from reading blogs online and other videos that actually make the effort of telling why something is being done, what the end objective is, and how writing code the way it was written here helps us do that better.

  12. Thank youuuuuuu❤

  13. best video to understand oops, heartfull thank to instuctor CRYSTAL CLEAR EXPLANATION

  14. thanks jim, you're an absolute legend

  15. It was So helpful ,Thank you

  16. Thank you🤝

  17. too many fuckin adds … really annoying

  18. Staticmethod and classmethod have really confused me..

  19. class vs static method was difficult to understand.As a beginner , i had no idea about csv and the thing going on with it😖😩

  20. I have a basic (probably) but important problem. When you instantiate manually e.g. 'item1 = Item("MyItem", 750)' you call methods e.g. 'item1.name = "OtherItemmmmm"' , but I am working with the csv instantiation.

    How do you refer to an instance of an object that has been instantiated from the csv to call a method then as they have not been given a name?????

    Any help gratefully received,

    Thanks

    Edit: I think I have solved it:

    The list is more than just a list, it actually points to the objects??, I used:

    for i in Item.all:
    if i.name == "Phone":
    print(i.calculate_total_price())
    i.name = "Phone3"
    print(i)

    Because the i.calculate_total_price() worked, it must be pointing to the instantiated object right??

    I then wrote a method to write back to csv all the items in the list and it worked!!!
    Item.write_to_csv()

    Tell me if I am wrong, but it seems to be fine.

  21. Is this video is only for oops concept…..I have to learn ooops concept will this video helps me ?

  22. Excellent content , well and deeply explained.
    Good reference

  23. I have a question about the setters. I didn’t understand when I should use them. It seems that all its doing is negating the read only property and if I don’t want an attribute to be a property shouldn’t I just remove the property why implement it in the first place?

  24. so finally i could learn "self" OOP in python Thx sooo muchh <3

  25. It was good until you added in the complexity of installing packages to deal with csv files and then attempting to use those packages. It didn't seem necessary or particularly relevant to oop. Granted, I'm not that experienced, but then I probably wouldn't be watching the video if I was. For someone who is attempting to grasp oop, that was an unnecessary tangent that ultimately drove me away.

  26. Doubts :
    1) 1:07:04

  27. 00:04 Understanding object oriented programming is important for software developers.
    07:57 Creating a method to calculate the total price of items
    23:21 Understanding constructors and best practices in classes
    31:11 Learned about constructor and working with different attributes
    45:44 Using a for loop, we can print the names of all instances
    53:38 Read CSV file and instantiate objects with class method.
    1:09:32 Create a separate class named 'Phone' that inherits from the 'Item' class
    1:17:02 Inheritance allows creating child classes that inherit attributes and methods from parent classes.
    1:31:54 Create read-only attributes in Python using the property decorator
    1:39:20 By adding double underscores to attribute names, access to those attributes is prevented outside of the class.
    1:54:40 Encapsulation and abstraction principles are applied in object-oriented programming.
    2:03:06 Inheritance allows code reuse across classes

  28. If you guys get error with csv package, feel free to use pandas and in instantiate_from_csv class methods use the following code:
    @classmethod

    def instantiate_from_csv(cls):

    csv_file_path = "Items.csv"

    df = pd.read_csv(csv_file_path)

    data_dict = df.to_dict(orient='records')

    for item in data_dict:

    Item(

    name = item['name'],

    price = item.get('price'),

    quantity = item.get('quantity')

    )

  29. Great tutorial! Does anybody know what color theme is he using??

  30. Everything I got little confused then he says "what that means? It means"….. and things were crystal clear!!

  31. I have following code and as mentioned in 26:48 I must receive an error of type mismatch but I'm not receiving that error message and if I call cal_total_price function it just print t 10 times

    class Item:

    def cal_total_price(self):

    return self.quantity * self.price

    #argumented constructor

    def __init__(self,name:str,price:float,quantity:int):

    self.name = name

    self.price = price

    self.quantity = quantity

    item2 = Item("Laptop","t",10)

  32. Would be nice if you could show how to inherit a value from a getter method in the super class by calling it in a child class

  33. Thank you so much

  34. Can someone explain how that static method is_integer() works? I am finding it difficult to comprehend how that point zero is left out.

  35. I dont understand why there is no python icon in my vs code on the top right most corner and why there is no suggestion for extension for reading csv files in my vs code please help . i installed the CSV Rainbow extension but i dont have the option to see the data in the tabular form

  36. on 27:06, i typed name: str, and i still managed to insert an int or any other value. after some research, turns out these are considered a mere hints for some tools to pick to guide the user for the proper data type. but really you can't dictate user to use any certain data type except with *assert*. or at least that's what i found.

  37. Just finished this video.
    Took me around 5 6 hours while coding everything myself, clearing my own small doubts, and testing the code.
    Learned so much its amazing. Thanks freeCodeCamp and Jim for this amazing video

  38. as the one learning different things and trying different approaches all the time , I would say it was very informative and most importantly not boring and out of topic and also was concise

    Thank you

  39. Amazing lecture and very engaging

  40. By far the best EXPLANATION of OOP concert I’ve watched, and I’ve watched a few. Thank you so much!

  41. my opinion, you guys should learn OOP with java or C++ to fully understand

  42. if you see this comment. Please stop search python class course, this video is already all you need to know

  43. One of the BEST python tutorials i have ever seen. Most just show you the code and expect you to understand it but in this video he explains EVERYTHING thank you so much, i have learned a ton about python because of you!

  44. Very informative. Thanks a lot.

  45. Really it was a great video. Learnt more with magic methods _repr_

  46. class Framework:

    def __init__(self, name: str, version: str) -> None:

    self.__name = name

    self.__version = version

    @property

    def name(self) -> str:

    return self.__name

    @name.setter

    def name(self, name: str) -> None:

    self.__name = name

    @property

    def version(self) -> str:

    return self.__version

    @version.setter

    def version(self, version: str) -> None:

    self.__version = version

    dotnet = Framework(".NET", "9.0")

    print(dotnet.name)

    print(dotnet.version)

    dotnet.name = ".NET Framework"

    print(dotnet.name)

    dotnet.version = "4.8"

    print(dotnet.version)

  47. Helpfull for any level

  48. Such a great and informative tutorial. I think you guys should posted a separate video especially in python for data structures and algorithm

  49. thanks for creating such a great video guys i really like it

Leave your thought here

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

Enable Notifications OK No thanks