Python - Object Oriented Programming | Encapsulation

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 36

  • @miwwie1504
    @miwwie1504 Рік тому +20

    Can't believe a level 9999 Indian overlord explained this way better in 8 minutes than my top ranked college did.

    • @Bitfumes
      @Bitfumes  Рік тому

      Thanks for your love and support, keep learning. Join bitfumes telegram group t.me/bitfumes

    • @ElamW-bz3jt
      @ElamW-bz3jt 2 місяці тому

      How to detect scammers or bullshit videos, 1: speaker is Indian.

    • @DirisalaSandeepKumar
      @DirisalaSandeepKumar 2 місяці тому

      @@ElamW-bz3jt what's wrong with you ?

  • @guilhermecampos8313
    @guilhermecampos8313 2 роки тому +6

    Thank you mister, finally I'm able to use proper encapsulation in python!

  • @Nahzh-m1r
    @Nahzh-m1r 4 місяці тому

    Wow gotta say the best video ever. I wish he was my programming professor. To be honest programmers on UA-cam are better than some professors we have in the U.S universities.

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

    thank you, short, simple and clear

  • @minhkhoi4108
    @minhkhoi4108 7 місяців тому

    Crystal clear explanation! Salute to you sir.

  • @daveanvs
    @daveanvs Рік тому

    Excellent explanation

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

    VERY well explained, thank you!

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

    class Payment:
    def __init__(self, price):
    self.__final_price = price + price * 0.02
    book = Payment(100)
    book.__final_price = 0
    print(book.__final_price)
    output - 0
    the value of the final_price variable is changing what's happening?

    • @akashgeorge5433
      @akashgeorge5433 Місяць тому

      it is not changing it is basically creating one more __final_price and setting that to zero ,if you create a show function and reutrn self.__final_price you will notice that it hasnt changes , finally print(objectname.__dict__) to understnad better

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

    Amazing tutorial

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

    Smooth bruh

    • @Bitfumes
      @Bitfumes  2 роки тому

      thanks
      Thanks for watching, please subscribe and like this video

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

    hello!! , you didnt explain about the 9th line , kindly check and try to explain what u have done in the line 9 in your code>

  • @emredilek2226
    @emredilek2226 3 роки тому

    love your vid, thanks

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

    Thanks ❤❤❤❤ lot you made it very easy 😊 where from buddy

    • @Bitfumes
      @Bitfumes  4 місяці тому

      Thanks for your love and support, keep learning. Join bitfumes newsletter bitfumes.com/newsletters

  • @skhumbuzocele1330
    @skhumbuzocele1330 2 роки тому

    A better explanation but not quite easy.

  • @rihanansari3486
    @rihanansari3486 5 років тому +1

    loved the way you teach , do you have anything for Django also?? (videos playlist)

    • @Bitfumes
      @Bitfumes  5 років тому +1

      Not now, but will start soon

  • @PraveenKumar-jr3wq
    @PraveenKumar-jr3wq 6 років тому

    Thanks a lot

  • @jahiddevcoder1847
    @jahiddevcoder1847 2 роки тому

    That's awesome

  • @seandreihere
    @seandreihere Рік тому +1

  • @ahmadeyamin3836
    @ahmadeyamin3836 6 років тому

    Love you boss 😘

    • @Bitfumes
      @Bitfumes  6 років тому

      Thanks for watching, please like Bitfumes on facebook/twitter for more updates.

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

    6:24, how are you using the 'discount' parameter without instantiating it?

  • @akashgeorge5433
    @akashgeorge5433 Місяць тому

    gr8 explanation , thanks for uploading
    I have a doubt however , when i tried to access the pvt variable it gave an error as expected but it also suggest to use objectname._A__name , meaning I am able to edit the pvt variable using it , can somone pls tell how we can prevent that ```class A:
    def __init__(self, name):
    self.__name = name
    def show(self):
    return self.__name
    def setter(self,newname):
    self.__name = newname
    a = A("akash")
    a.setter("lokesh")
    a._A__name = "tommy"
    print(a.show())```
    >>>tommy

  • @raphaelchagas1676
    @raphaelchagas1676 2 роки тому

    You changed the 9th line into commentary. If you hadn't done that, the final price would've still been changed.
    That some bad teaching here. >:(

  • @arymanusingh1742
    @arymanusingh1742 2 роки тому

    Single underscore is protected. And double is private. Stop fooling. Its nothing such thing like warning

    • @nethravathi2845
      @nethravathi2845 2 роки тому

      you might be from different language, so you think it is type of foolish or else if you are from python domain, learn about access specifiers

    • @pencodes3580
      @pencodes3580 2 роки тому

      your problem is you are a joke. single underscore is protected but it is not enforced when you use it outside thats why it is acting as a warning

  • @rindratianaratsimandavana9867
    @rindratianaratsimandavana9867 3 роки тому

    Thank you very much