Object Oriented Programming in python

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Visit chaicode.com for all related materials, community help, source code etc.
    Welcome to chai aur code, a coding/programming dedicated channel in Hindi language. Now you can learn best of programming concepts with industry standard practical guide in Hindi language.
    All source code is available at my Github account:
    github.com/hit...
    Our Open-Source Project is here: freeapi.app
    Join me at whatsapp: hitesh.ai/what...
    for community discord: hitesh.ai/discord
    Instagram pe yaha paaye jaate h:
    / hiteshchoudharyofficial
    HTML video series: • HTML and VSCode - gett...
    Complete javascript series: • Javascript for beginne...
    Complete Reactjs series: • React JS roadmap | cha...
    Javascript and react interview series: • 1 call se shuru hui pl...
    Backend development with Javascript: • Javascript Backend Roa...
    Python Series: • Python series launch |...

Комментарии • 821

  • @kaustubhgaikwad2562
    @kaustubhgaikwad2562 2 месяца назад +31

    4 months but still no 800 comments 😭 He is god level teacher .. help his channel grow

  • @swarnabhamajumder9561
    @swarnabhamajumder9561 6 месяцев назад +45

    Learning Python Day 12 - present sir
    00:03 Object Oriented Programming is like making Gujiya
    01:58 Understanding object-oriented programming through generalized forms and classes.
    05:45 Follow naming conventions and indentation in Python classes.
    07:41 Understanding object creation and attributes in Python
    11:41 Understanding object-oriented programming in Python.
    13:36 Understanding the usage of variables and parameters inside a class in Python
    17:44 Method to display full name of car brand and model
    19:49 Object-oriented programming concepts in Python
    24:06 Creating object and setting up wireless connection
    25:55 Using inheritance and 'super' keyword to access parent class methods and attributes in Python
    29:34 Encapsulation is about controlling access to class attributes
    31:32 Creating methods for accessing and setting attributes in Python
    35:31 Encapsulation and its importance
    37:36 Polymorphism allows different behaviors for objects of the same class.
    41:16 Class variables keep track of shared data, like counting instances.
    43:32 Object creation and access in OOP Python
    47:44 Static method in Java is a method belonging to the class, not owned by an instance.
    49:52 Linking and Wiring in Object Oriented Programming
    53:32 Decorators in Python allow you to modify functions.
    55:19 Understanding data encapsulation and access control in object-oriented programming
    58:51 Understanding the usage of decorators in Python
    1:00:42 Understanding property decorators in Python.
    1:04:49 Inheritance in electric car programming
    1:06:54 Python supports classes, inheritance, and methods

  • @Thecircuit001
    @Thecircuit001 6 месяцев назад +15

    I don’t know why this man is sharing this type of content free in youtube…. 😊…. Sooo much love…. So much valuable information ❤

    • @sidhantarya2483
      @sidhantarya2483 6 месяцев назад +4

      Bharat is already famous for rishi-muni gurus and hitesh sir wants best software engineers will also be from India in the whole world.

  • @anujpoudel
    @anujpoudel 6 месяцев назад +24

    58:15
    when you did 'my_car.model = "City" ' in line 41 in that instance new property/attribute 'model' was created so now there are two attributes one '__model' and another 'model' for object 'my_car'. This happens because we can create new property for any object on the go and is not necessary to be in the class.

    • @soumalyadas1123
      @soumalyadas1123 3 месяца назад +1

      fine observation.

    • @harshmeetsinghsaluja9773
      @harshmeetsinghsaluja9773 2 месяца назад

      exactly dude....i was confused for 2 hrs and when i figured it out, i saw ur comment ;-;

    • @DesaiGauravS-
      @DesaiGauravS- Месяц назад

      thank y

    • @Airman.programer
      @Airman.programer 15 дней назад

      class Car:
      def __init__(self, brand, model):
      self.brand = brand
      self.__model = model

      @property
      def model(self):
      return self.__model

      mycar = Car("tata", "safari")
      print(mycar.model)
      # mycar.model = "city" #this line will give error
      is this correct code ? ?

  • @pranaypaul6361
    @pranaypaul6361 6 месяцев назад +5

    In Python, static methods are indeed meant to be accessed by the class itself rather than by instances of the class. However, there is a subtle difference in how static methods are defined and accessed in Python compared to other programming languages like Java or C++.
    In Python, static methods are declared using the `@staticmethod` decorator, which specifies that the method should be treated as a static method. However, static methods in Python are not truly bound to the class itself. Instead, they are bound to the class's namespace, which is the same namespace that contains the class's other attributes and methods.
    This means that while static methods can be accessed using the class name, they can also be accessed using an instance of the class, as shown in the example you provided. When you call a static method using an instance of the class, the instance itself is not used in any way. The method is simply called using the class's namespace.
    This behavior is different from static methods in other programming languages, where static methods are truly bound to the class and cannot be accessed using an instance of the class. In Python, the ability to access static methods using both the class name and an instance of the class provides greater flexibility and allows for more concise code in certain situations.
    It's important to note that while static methods can be accessed using both the class name and an instance of the class, they should generally be accessed using the class name for consistency and clarity.
    class MyClass:
    @staticmethod
    def my_static_method():
    print("Hello from static method!")
    # Calling using the class name
    MyClass.my_static_method() # Output: Hello from static method!
    # Calling using an object
    obj = MyClass()
    obj.my_static_method() # Output: Hello from static method!

    • @priyeshsingh7586
      @priyeshsingh7586 6 месяцев назад

      Just thinking what will be a production scenario where static method can be used by both Class and instance of the class as described above.

    • @M_Abdul1ah
      @M_Abdul1ah 2 месяца назад

      Scrolling through the comments to find someone discussing this… and here you are, brother.♥️

  • @Debraj-HTC
    @Debraj-HTC 6 месяцев назад +9

    Finally undestoood classes in python so easily, now i finally get what that self, and constructor and how to use them, earlier it was so confusing. Thank you!

  • @karannegi-y4m
    @karannegi-y4m 2 дня назад +1

    i noticed a good point in static method that we can execute static function using object but we have to remove " self " as a parameter from static function that means we are not sending a reference of our object ( self contains reference of object ) that we are accessing the static by class only

  • @devottamvaishnav65
    @devottamvaishnav65 5 месяцев назад +3

    OOPs was so confusing for me earlier! Finally undestoood classes in python so easily, now i finally get what that self, and constructor and how to use them. Thank you so much sir!

  • @soumyaranjanghadei6137
    @soumyaranjanghadei6137 Месяц назад +1

    Finally undestoood classes in python so easily, now i finally get what that self, and constructor and how to use them, earlier it was so confusing. Thank you!

  • @mubeenashraf8676
    @mubeenashraf8676 4 месяца назад +2

    The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed. Empty code is not allowed in loops, function definitions, class definitions, or in if statements.

  • @manasanmol6604
    @manasanmol6604 3 месяца назад +3

    Finally found such a detailed playlist, was looking back to remember the definitions when I stumbled over this

  • @anonyone8834
    @anonyone8834 6 месяцев назад +5

    Pass is special keyword used as a placeholder for a code. In python when we make a class and we want to specify the use case later we just use pass to avoid error and code still being empty

  • @pranjul4018
    @pranjul4018 22 дня назад +1

    if someone ask me how to learn python, this is one of the best playlist ever (especially this video on OOPs). Itna accha video OOPs jaise concept pe koi kaise bna sakta hai 🤷‍♂👌

  • @prashantswaroop4801
    @prashantswaroop4801 Месяц назад +1

    Awesomely done. Hands the best teacher I have ever seen. cleared all the basics practically you are truly a gem sir for the Indian coding community. Thanks

  • @danielhaidari1638
    @danielhaidari1638 6 месяцев назад +4

    been following your videos since 2018 and LCO courses since I was in high school now in my second year uni in Aus. appreciate your work

  • @poojaheera5980
    @poojaheera5980 11 дней назад +1

    Isse acha content nai dekha mane related to learning python. Best playlist 😍

  • @hetashrikansariwala9527
    @hetashrikansariwala9527 6 месяцев назад +3

    I am trying to learn oops in python since many days but unable because of you now I am confident in oops. Thank you sir

  • @sky.digitalmedia2732
    @sky.digitalmedia2732 5 месяцев назад +2

    Sir, you teach in such a way which make any complex topic very easy
    💯💯💯💯

  • @mrayyan8813
    @mrayyan8813 22 дня назад

    learning Python Day 12 - present sir
    00:03 Object Oriented Programming is like making Gujiya
    01:58 Understanding object-oriented programming through generalized forms and classes.
    05:45 Follow naming conventions and indentation in Python classes.
    07:41 Understanding object creation and attributes in Python
    11:41 Understanding object-oriented programming in Python.
    13:36 Understanding the usage of variables and parameters inside a class in Python
    17:44 Method to display full name of car brand and model
    19:49 Object-oriented programming concepts in Python
    24:06 Creating object and setting up wireless connection
    25:55 Using inheritance and 'super' keyword to access parent class methods and attributes in Python
    29:34 Encapsulation is about controlling access to class attributes
    31:32 Creating methods for accessing and setting attributes in Python
    35:31 Encapsulation and its importance
    37:36 Polymorphism allows different behaviors for objects of the same class.
    41:16 Class variables keep track of shared data, like counting instances.
    43:32 Object creation and access in OOP Python
    47:44 Static method in Java is a method belonging to the class, not owned by an instance.
    49:52 Linking and Wiring in Object Oriented Programming
    53:32 Decorators in Python allow you to modify functions.
    55:19 Understanding data encapsulation and access control in object-oriented programming
    58:51 Understanding the usage of decorators in Python
    1:00:42 Understanding property decorators in Python.
    1:04:49 Inheritance in electric car programming
    1:06:54 Python supports classes, inheritance, and methods

  • @Haha1234-z7f
    @Haha1234-z7f Месяц назад +1

    When you are removing the self from general description at 50 min that time you by mistake your removed self of fuel type in ElectricCar class not major issue just giving a good feedback. Love you sir you are great !!!

  • @ashurathi9286
    @ashurathi9286 Месяц назад +3

    dialogue yaad agya😂"Maamla aagya h class ka aur tum maat khaa gye ho class se kuki ham h unchi class ke aur tum ho nichi class ke"

  • @eduhub3416
    @eduhub3416 2 месяца назад +2

    52:25 jab staticmethod use kar k method bnaye the to obj se acess ho jatata sir
    Ex-
    print(my_car.general_description())
    print(Car.general_description())
    output :-
    Cars are means of transport
    Cars are means of transport

  • @utkarshsingh1128
    @utkarshsingh1128 3 месяца назад

    28:37 / 1:08:28 Encapsulation __brand ->private (only class members can use not outsider object) {hence data is encapsulated }
    36:45 / 1:08:28 Class Variable

  • @adityagupta1479
    @adityagupta1479 2 месяца назад

    Sir, you teach in such a way which make any complex topic very easy

  • @ankitpartap185
    @ankitpartap185 Месяц назад +1

    Amazing video on Python OOPs. Etna toh college may nai krvaya jitna apnay ek vidoe may krva diya sir!!!! 😄

  • @gamerk88
    @gamerk88 2 месяца назад

    I was stucked in OOp s in python for a day and then I find this vid and understand everything.Highly recommended for understanding oops in python.

  • @SobanToor
    @SobanToor 2 месяца назад

    One of the best videos on Object-Oriented Programming in python I have ever witnessed.

  • @shreyasjoshi3742
    @shreyasjoshi3742 Месяц назад

    My friend recommended me about this channel, and I love the way of teaching.

  • @siddhant2943
    @siddhant2943 2 месяца назад

    I already knew objected oriented programming concepts in C++ and Java, it is amazing to see how different languages always come with something new to offer, this pointer in C++, super() method in java, @property decorator in python.

  • @thatone.nerdguy
    @thatone.nerdguy Месяц назад

    I've been watching series fr last 7 days this has been best course, ab mujhe OOPs relatable lagne lga h - 1 August 2024

  • @starksanket3880
    @starksanket3880 2 месяца назад

    Sir, your approach to coding is as simple and refreshing as making a cup of tea. Just like brewing the perfect chai, you blend simplicity with richness, making the learning process both delightful and flavorful. Keep serving those amazing tutorials, they're a treat to our minds!

  • @lakshyaaggarwal1608
    @lakshyaaggarwal1608 2 месяца назад

    Sir You have made things so easy and made me learn to write project code with industry standard while being in college, I have also seen your backend playlist and it has helped me a lot thx a lot

  • @Waleedkkhan594
    @Waleedkkhan594 5 месяцев назад

    This single video is more valuable then some RUclipsr's entire channels. Incredible work sir. I learnt so many things. Oops inheritance, polymorphism, constructor, decorator thank you so much sir

  • @muhammadhilal5807
    @muhammadhilal5807 6 месяцев назад

    i thought that this would be that boring video by learning the OOP with fancy names, but loved it how you explain it by just solving problems and learning along with it.

  • @akashkr8541
    @akashkr8541 4 месяца назад

    oop se jaldi main bachpan me cycle sikh lia tha. now i am here. thanks for this video. i am going to watch it fully.

  • @Vishal_0841
    @Vishal_0841 6 месяцев назад +2

    Guru ji imandari se ab question solve kar raha hu mza aa raha hai ❤

  • @manavbhatt3169
    @manavbhatt3169 2 месяца назад

    I have completed the full video at once i loved the way hitesh sir teach , he teached all the concepts so smoothly and in very easy way , Big Thanks for this series sir 🙏✨️

  • @dysproghoul
    @dysproghoul 2 месяца назад

    this is was perfect rather than those basic generic oops videos
    this covered most of the things

  • @naziabegumsiddique1504
    @naziabegumsiddique1504 Месяц назад

    i started late but i want you to teach us more your channel make me belive that i also code if teacher is this level good.

  • @spm_01
    @spm_01 4 месяца назад

    very nice video with full of learning I am in 4th year now I learnt how to play with oops with python - thank you so much sir :)))

  • @karnrkyt
    @karnrkyt 2 месяца назад

    10 questions are the best way to teach and learn. maza aa rha hai ish series m😊 great content @hitesh sir

  • @user-pl8qb3tu8d
    @user-pl8qb3tu8d 24 дня назад

    Nice way of teaching , and very interesting really I enjoy a lot. Thanks This was my first lecture, impressive

  • @xander-sum
    @xander-sum 23 дня назад

    OOPs - Finally got some valuable knowledge.
    🙏Thank you for clear explanation

  • @vardanshprasad5801
    @vardanshprasad5801 6 месяцев назад +1

    Sir apka English Bahut accha hai free codecamp pe dekha hai

  • @priyankagehlot9945
    @priyankagehlot9945 Месяц назад +1

    1:08:13
    ek channel aaya h "chai aur code" ☕❤, jo dil se pdhate h aur dil se smjate h❤❤❤❤❤❤❤❤

  • @dipayankarmakar5275
    @dipayankarmakar5275 Месяц назад

    This series is very underrated....and explanations are God lvl🔥🔥

  • @AlokCodes1
    @AlokCodes1 3 месяца назад +2

    sir, there is a conceptual mistake at 51:47 . You said that the objects can not access static methods, but static method works on classed as well as instances of that class . Investigation study karke pata kiya :)
    thanks for these lectures (i find this playlist as the fastest way to learn and gain confidence in python)
    For the viewers: The difference between a normal method and static method is that inside a static method, you can't use any of the properties or method associated with the class. All the implementation has to be done using the parameters of that static method. BTW there is also a classmethod decorator, explore it also

    • @shrehanarya-iw6vx
      @shrehanarya-iw6vx 2 месяца назад

      thank you so much bhaiya mujhe lag raha tha ki mere code me error h :)

  • @krishnamania1
    @krishnamania1 6 месяцев назад +1

    Thank you sir , this is the first time I completely understand OOPS

  • @sudhanshushekhar1116
    @sudhanshushekhar1116 4 месяца назад

    I am trying to understand this concept since many months. Now it's clear. Thanks!
    could you please teach some project on basis of oops?

  • @Jatin_Jaunwal
    @Jatin_Jaunwal 2 месяца назад

    One of the best videos on Python lecture and easily explains the difficult topics Thank you so much, sir 😇

  • @farooqaziz3738
    @farooqaziz3738 2 месяца назад

    Sir mai python oops ki wajah se interview crack nhi saka
    Lekin aapke video dekhne ke baad mujhe oops ke all concept clear ho Gaye
    Thanks for sharing this useful knowledge

  • @MCA_HimanshuSeth
    @MCA_HimanshuSeth 5 месяцев назад

    Gujiya wala example is superb for understanding classes & objects

  • @shahbajalam2076
    @shahbajalam2076 3 месяца назад +1

    Whoever is watching this video, just remember, the static method part is wrong. The class instance can 100% access the static method. Both class and instance can access the static methods. Static method means it does not get created for each instance, rather it gets created for only once.

  • @Airman.programer
    @Airman.programer 15 дней назад

    def chai(num):
    def actual(x):
    return x ** num
    return actual
    f = chai(2)
    g = chai(3)
    print(f(2))
    print(g(2))

  • @ZakirHussain-nd4fw
    @ZakirHussain-nd4fw 5 месяцев назад

    once our teacher was explaining OOP some 7 years back , with Apple as an example, so we understood the definitions, but created confusion by giving example of colour , shape of car, apple etc..

  • @Zeeshantariqpkn
    @Zeeshantariqpkn 3 месяца назад

    Method of teaching so perfect with real time examples, can in django series create a video on creating user wiith rights no one created on it yet.

  • @khawaja_here
    @khawaja_here 2 месяца назад

    First time am fully understand the concepts of OOP Thank you so much sir

  • @ravijangra3871
    @ravijangra3871 Месяц назад

    question no. 5 also makes us understand the concept of method overriding

  • @subhasreekar1297
    @subhasreekar1297 3 месяца назад

    You have explained all the concepts very easily ... Good for the beginners like me😊

  • @VivekKumarMaurya-qp4el
    @VivekKumarMaurya-qp4el Месяц назад

    This was really something i didn't get it for the first time had to watch twice and i do get this and i think some projects will bring clarity

  • @the.ideal.indian
    @the.ideal.indian 2 месяца назад

    Thank you for your dedication to sharing your knowledge and for creating such high-quality content. Your efforts are truly appreciated and have made a significant impact on my learning journey.

  • @sufiyanpatel6241
    @sufiyanpatel6241 Месяц назад

    Perfect Teaching... Clear OOPs concept in python....

  • @sheshadrivijay8014
    @sheshadrivijay8014 Месяц назад

    Excited to learn the complex topic in a simple manner with help of master #Hithesh #Chai aur Code

  • @siddheshabhang9992
    @siddheshabhang9992 Месяц назад

    Wow, Finally undestoood classes in python so easily, now

  • @mirkamrulahsanasif3474
    @mirkamrulahsanasif3474 21 день назад

    Sir, in Bangladesh we call it 'pooli pitha'. pooli means stuffing inside of it and pooli pitha means paee(hindi) with stuffings.

  • @suryaa_tycoons4455
    @suryaa_tycoons4455 Месяц назад

    Hats off sir no one teaching like this

  • @AmitSinghShekhawat-kp8zu
    @AmitSinghShekhawat-kp8zu 3 месяца назад

    Great explanation sir till 17th lecture but needed more SPECIFIC & TECHNICAL explanation in Theory of OOPS as first time its seems a bit harder.

  • @high5537
    @high5537 Месяц назад

    I truly appreciate your efforts to teach us programming. Thanks for this informative video it helped me a lot :)

  • @mdnozibuddowla4085
    @mdnozibuddowla4085 2 месяца назад

    agar mein is video full dekhne ki baad oop sikh jate hein to meri jitni bhi gmail account hein o sab se aap ki account ko subscribes karenge. because I am learning coding from 2016 se. abhi bhi oop mein bohot sari problems ate rehte hein. video dekhna start kari rahi hu.hope for the best

  • @Nooresagheer
    @Nooresagheer 29 дней назад

    ❤❤❤❤❤❤علم دینے کا بہت شکریا😊

  • @nikshadali50
    @nikshadali50 6 месяцев назад

    Sir, you teach in such a way which make any complex topic very easy

  • @addictivecore2272
    @addictivecore2272 2 месяца назад

    COMMENT KARO BHAI . . . .
    best python series EVER

  • @tarunsikarwar
    @tarunsikarwar 6 месяцев назад +1

    amazing teaching skill Hitesh ji. please make a series of Fastapi in hindi

  • @user-cp9kt3qq2d
    @user-cp9kt3qq2d 6 месяцев назад +1

    Thank you so much sir for oops concept explanation in a very easy manner 🙏

  • @Mortec593
    @Mortec593 6 месяцев назад +20

    Who will stay for the end of the series

  • @krishnapalsingh2777
    @krishnapalsingh2777 6 месяцев назад

    Super 🧑‍🔧 "Thoda difficult lg rha hai" 2,3 bar dekhne pr samjh a jaiga😊

  • @proPakistani54
    @proPakistani54 6 месяцев назад +3

    Krdya ❤❤❤

  • @ShafiullahCrazyman
    @ShafiullahCrazyman 4 месяца назад

    It's so higher level for me but I watching two times then I understood amazing Ha! Good work bro 1:07:56

  • @MCoder-x
    @MCoder-x 3 месяца назад

    I think this was the best explanation to OOP. Thank you sir🙌🏻

  • @Happinessaroundme
    @Happinessaroundme 11 дней назад

    Finally I understood the concept 🤍

  • @ck0024
    @ck0024 6 месяцев назад +1

    Attribute = Property = Variable
    Method = Function

  • @rawalbalouch5286
    @rawalbalouch5286 Месяц назад

    I really like the way you delivered thanks many thanks from PAK

  • @TLP2007
    @TLP2007 Месяц назад

    This is a good channel in the youtube i have ever seen😁😁😁😁😁😁😁

  • @TechTutorialswithPiyush
    @TechTutorialswithPiyush 4 месяца назад

    Shuruwat majburi me kari thi Python, ab maja aara hain ❤

  • @user-fc7mm2hx5z
    @user-fc7mm2hx5z 2 месяца назад

    BRO LITERALLY THANK YOU FROM THE CORE OF MY HEEART

  • @Ady-tf1jm
    @Ady-tf1jm 2 месяца назад

    Thankyou Sir. Apne bhot easy way mai samja diya.

  • @chandranitr5003
    @chandranitr5003 2 месяца назад

    Amazing! I understand very well. Thank you sir

  • @user-iv9zj7ld8x
    @user-iv9zj7ld8x Месяц назад +1

    Complete oop concept thanks sir ♥️♥️

  • @nayanranjanbiswal9534
    @nayanranjanbiswal9534 6 месяцев назад

    I got addicted by this channel "Chai aur Code"

  • @VishalMudgal-it9qy
    @VishalMudgal-it9qy 4 месяца назад

    mast samjhate ho sir , Ek baar m samjh aa ja rha h 😁😁

  • @SHRUTIBEDARKAR
    @SHRUTIBEDARKAR Месяц назад +1

    extraordinary teaching

  • @user-pz2oq2qx4u
    @user-pz2oq2qx4u 6 месяцев назад

    this is the best video i ever seen to learn oop concepts in python

  • @anoopverma6990
    @anoopverma6990 6 месяцев назад

    Understanding "closure" is tough.
    Will have to work more on it.

  • @pratikkesharwani9080
    @pratikkesharwani9080 20 дней назад

    "Pass" :- Pass statement is used as a placeholder for future code. When pass statement executed nothing happen but we can avoid the error, when empty code is not allowed.

  • @vaishnavikulkarni663
    @vaishnavikulkarni663 2 месяца назад

    Thank you sir. You made this topic so much easier to learn

  • @entertainmentkidzzclub6591
    @entertainmentkidzzclub6591 2 месяца назад

    great video sir clear more concepts i always confused with static method but you clear it very simply

  • @shaikusman536
    @shaikusman536 3 месяца назад

    Awsome content Hitesh sir ji...........Thanks a ton ...keep up the great work....Respect from Bangalore.

  • @devilislive8134
    @devilislive8134 5 месяцев назад

    Bro you are really helping students a lot in such simple answers

  • @SIR_Studios786
    @SIR_Studios786 6 месяцев назад

    good explanation with examples, c++, c# etc language used preface like private, public, static etc, but in python underscores and decorators play such roles.

  • @fuzelmultani2290
    @fuzelmultani2290 Месяц назад

    your explanation is really good. please make some complex projects. I want to practice advance python.