Classes and Objects (Python) - Data Structures and Algorithms

Поділитися
Вставка

КОМЕНТАРІ • 12

  • @jpkeys6000
    @jpkeys6000 3 роки тому +2

    This is pure gold!

  • @LeCodeurNul6418
    @LeCodeurNul6418 5 місяців тому

    Thanks you for everything

  • @technick3913
    @technick3913 4 роки тому +1

    I did not understand the creation of another class "CameraType" inside a preexisting class Camera

    • @abdelkarimbadaoui6586
      @abdelkarimbadaoui6586 4 роки тому

      Yeah got the same problem right here but i don't think of it as a big deal he import somthing to help him in that class thought and i think that is what keep us away from understanding what he did

    • @daverussell4052
      @daverussell4052 4 роки тому

      its basicly an enum inside a class you can print the value with camera_type.value

  • @danny12345
    @danny12345 4 роки тому +1

    god lesson

  • @priyanshtiwari8317
    @priyanshtiwari8317 4 роки тому +4

    Sir you are great

  • @walterstevens8676
    @walterstevens8676 2 роки тому +1

    I like your other videos but I think I'm particularly slow to pick up the class/object thing. So this video lost me pretty quickly.

    • @codymccarty9327
      @codymccarty9327 2 роки тому +2

      If it helps:
      objects have key: value pairs i.e. codyStats = {name: Cody, height: 60, eyes: blue}. Name is a key, and cody is the value.
      Classes are an abstraction of objects, or a blueprint for creating objects. The reasons this is done is for maintainability of large systems. We don't want Bill leaving off his eye color and adding in his favorite basketball team when billStats is created, so we use Classes. Classes make all the objects have the same keys. Everytime a new personStats is made we want them to have the same keys, otherwise we can't predict how each person will behave.
      That's the basics. Then we can add functions or methods to the class that we want all personStats to have. Latter on there will also be interfaces, mixins, etc that build on and address short comings of this system.
      It's completely normal not to get this concept the first time around. No one does. This sounds counter intuitive, but keep writing code that doesn't make 100% sense. One day, you'll have seen code like this a 100 times and when you watch a video explaining the method to the maddess it will all click.

  • @kareemabdallah1340
    @kareemabdallah1340 2 роки тому +2

    everything was good until the self.position.log()