Object-oriented Programming (OOP) in Python (Easy to Understand Guide) #20

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

КОМЕНТАРІ • 179

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

    🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges.
    Try Programiz PRO: bit.ly/right-python

  • @Wrennvy
    @Wrennvy 3 роки тому +53

    class Triangle:
    def __init__(self, a, b, c):
    self.a = a
    self.b = b
    self.c = c
    def perimeter(self):
    p = [self.a, self.b, self.c]
    h = sum(p)
    return h
    t1 = Triangle(3, 4, 5)
    result = t1.perimeter()
    print(result)

  • @ravi2971
    @ravi2971 4 роки тому +117

    the clearest and most well-explained video on classes on UA-cam! Keep up the good work man!

  • @enzy6434
    @enzy6434 2 роки тому +7

    I’ve watched Python tutorial videos from pretty much all content creators worth anything and this guy is by far the best overall at teaching concepts in a clear and understandable manner.

  • @stephelisabeth3143
    @stephelisabeth3143 3 роки тому +33

    In my Python class, it has been hard to understand what you might actually use a class for and how it would be applied. I assumed it had to do with organization but it was hard for me to come up with specific instances and my professor honestly hasn't demonstrated that for us. You made it obvious in two seconds and it will make doing my assignments easier going forward. Thank you for that.

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

    I am a python beginner learner. I watched a bunch of videos on UA-cam but couldn't understand the concept of OOP. This video is an absolute gem. Thank you sir, in just 18 mins every part covered in the video was crystal clear. God bless. 😊

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

    class triangle:
    def __init__(self,a,b,c):
    self.side1=a
    self.side2=b
    self.side3=c
    def perimeter(self):
    return f"The perimeter of the triangle is {self.side3+self.side2+self.side1}"
    triangle1=triangle(3,4,5)
    perimeter1=triangle1.perimeter()
    print(perimeter1)

  • @rithikrishik5174
    @rithikrishik5174 3 роки тому +20

    class Triangle:
    def __init__(self,a,b,c):
    self.side1=a
    self.side2=b
    self.side3=c
    def Perimeter(self):
    p=self.side1+self.side2+self.side3
    return p
    T1=Triangle(3,4,5)
    print(T1.Perimeter())

  • @serpentinefireball
    @serpentinefireball 3 роки тому +6

    This is amazing! I watched quite a few tutorials on this topic before I found your video and none of them helped me understand the concept the way you did as a total beginner. Thank you!

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

    hey i bought one course of a popular python instructor. couldn't understand that and came here. and got crystal clear man! this is incredible. and here, i was pulling my hair off as to where am i going wrong. Cheers.

  • @dots223_
    @dots223_ 3 роки тому +6

    Finally, a video that clearly explains classes. Thank you!

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

    Huge thanks to Programiz team! I can see you guys have devoted a lot of effort into this video. Your script is the most concrete, clearest and easiest to understand. The step by step guidance also lays out the logics clearly and allows beginners to succeed in the programming task later, which is rarely seen in other tutorials. You are great python teachers!

  • @Another_Username-s9d
    @Another_Username-s9d 3 роки тому +2

    One of the best tutorials. I also like that you actually added a task at the end to check if we really understand

  • @mdiftekhar6876
    @mdiftekhar6876 3 роки тому +3

    class triangle:
    def __init__(self, a, b, c):
    self.a = a
    self.b = b
    self.c = c
    def add(self):
    return self.a + self.b + self.c
    tri1=triangle(3,4,5)
    print(tri1.add())
    tri2=triangle(7,8,9)
    print(tri2.add())
    tri3=triangle(2,3,6)
    print(tri3.add())

  • @peterchin6759
    @peterchin6759 3 роки тому +1

    Oh man!!!!!! The most concise explanation I have ever heard/ read. The only regret I had was that I couldn't discover your videos sooner.

  • @HamzaAli-iy3ws
    @HamzaAli-iy3ws 4 роки тому +25

    You are doing such a great work by helping us in learning python and with such an ease. Keep it up and wish you a great success!!!

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

    The Blueprint-House analog helped me. Your teaching employs common-sense. Common-sense isn't very common. This is the best Class/Object video on the net.
    Thank you for taking the time to make this video!

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

    A true master. I have watched your video many times. It is an extremely clear and concise way to teach OOP. Thank you!

  • @DigitalAcademyOnline
    @DigitalAcademyOnline 3 роки тому +3

    Learning Python is something you would like to get in your skills, but you do not know where to start? This NEW channel will help you out leaning Python Programming from scratch - for complete Beginners, Intermediate and Advanced Levels

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

    I was reading the Python official tutorial, which is great. But this video made it SO MUCH clearer! Thank you for the lesson. Keep up the good work.

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

    I just love your way of teaching..it makes everything clear to me.

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

    i love you pundit, everytime i have struggle i come to you and you always execute. love from uzebekistan
    - jamal

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

    class Triangle:
    def __init__(self,a,b,c):
    self.a = a
    self.b = b
    self.c = c
    def perimeter(self):
    sum = self.a + self.b + self.c
    return sum
    t1 = Triangle(3,4,5)
    print(t1.perimeter())

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

    I have watched many videos but trust me this video is the best i have ever seen.

  • @kamalelbo5116
    @kamalelbo5116 3 роки тому +1

    it's the best video explaining classes and OOP, good methodology and very good job,thanks

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

    very clear, thank you very much ! As a newbie as me, concrete examples with step by step explanation on python is very helpfull to get the concept of OOP.

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

    Sir! what is self and why we use itm

  • @jeffnc
    @jeffnc 3 роки тому +5

    Thank you this was very useful. I liked that you include an exercise at the end too, I feel I have a much better understanding now :)

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

    Love the website and tutorials! High-quality content 👌

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

    This video cleared all my doubts, thank you so much, you taught very well

  • @MGrace01
    @MGrace01 3 роки тому +1

    class triangle:
    def __init__ (self,a,b,c):
    self.a = a
    self.b = b
    self.c = c
    def calculate_perimeter(self):
    sides = [self.a,self.b,self.c]
    return sum(sides)
    first_triangle = triangle(3,4,5)
    print(first_triangle.calculate_perimeter())

  • @ramonashiah9636
    @ramonashiah9636 3 роки тому +1

    I am still confused on the [15:27] line 14, the way we called the add method...

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

    Hi bro. Actually I was learning python since 1 month. Since one month what I learnt I never felt confused but today I was confused particularly this concept. Anyway I really thank full your concepts which you brought on screen to make help us.

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

    I've spent at least 3 days to figure out what the hell are "classes and object" in Python.Wow God blessed me found your video.That's very clear now I totally understand them.Thank you so much ! You got my like button and share

  • @NARASIMHAM1002
    @NARASIMHAM1002 4 роки тому +2

    Great work! Keep up the spirit and this channel will grow very soon.

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

    Well done. Very composed and well explained. I finally get it. This seemed like expert stuff for me for a long time, but not anymore. Don't change your tone because, In some other videos, the instructors act like they have to speak fast to come out as they know their stuff.

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

    I am glad I came across your channel , you explain in a very simple way . Way to go , keep rocking

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

    You the awesome trainer for this course in youtube platform ,really you explained all the topics with theory and code. Keep going on

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

    Thank you so so much for breaking Class down to be understandable. I am indeed grateful.

  • @Lekan-i1c
    @Lekan-i1c 8 місяців тому

    A lot of people must have said thank you but I will like to say it again. Thank you!

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

    this is the best video i have learnt from, and besides... your smile helps understand it better. thanks a lot for the explanation. keep the good work🥰.

  • @vengalrao5772
    @vengalrao5772 3 роки тому +1

    I got understand after many days 🙏❤️...but love this 💙💙💙

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

    This is was the most useful tutorial for classes and objects , thank you!

  • @fadilyassin4597
    @fadilyassin4597 3 роки тому +1

    well done very good I like the way you explained sttributes as variables and methods as functions it is important to define words first because it removes the confusion of names
    thanks again

  • @blindhydra
    @blindhydra 3 роки тому +1

    Great video! You are very skillful at teaching the information and progressing the difficulty, loved the video!! Thank you very much

  • @kumarprmshvm565
    @kumarprmshvm565 3 роки тому +1

    Your Videos are awesome, Man. Maybe it is not know to many.. I strongly believe you will succeed in u r mission

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

    class triangle:
    def __init__(self, a=0, b=0, c=0):
    self.side1 = a
    self.side2 = b
    self.side3 = c
    def calculating(self):
    perimeter = self.side1 + self.side2 + self.side3
    return perimeter
    T1 = triangle(3, 4, 5)
    print(T1.calculating())

  • @independent7212
    @independent7212 3 роки тому +1

    Keep it up sir... your way of expression and methods are amazing

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

    What the hell is my instructor explaining for past lecture and tutorial session? I watch this videos and everythings clicked for less than 2 minutes. Thank you for this.

  • @kajalchandravanshi2456
    @kajalchandravanshi2456 3 роки тому +1

    I found this very useful. Thankyou so much sir.😊😊 plzz keep uploading these kind of videos cause it will help a lot of students who are in search of crystal clear concepts with good examples.

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

    Thank you... Now I got clarity on OOP

  • @kyawswarthant708
    @kyawswarthant708 3 роки тому +1

    I am your fan now! Regret that I should check this simplest version first : )Thanks A Lot

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

    Thank you so much for explaining OOP in such an easy to understand way. You've been a great help. I've subscribed to your channel.

  • @tanvimutha4049
    @tanvimutha4049 4 роки тому +2

    Very well explained! Thank you for great work.Can't wait for the upcoming videos.

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

    This was an excellent video. It explained creation of objects so well. Thank you so much

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

    Excellent and very clear explanation of classes in Python!!!!
    I will suggest using different names of variables inside and outside of the class (result) to better understand the examples.
    Thank you!!!

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

    The concept is explained very clearly.. 😊

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

    thanks buddy it was fantastic

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

    Where to get the solutions??? Of the task you gave

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

    Legit tysm. Thank god I started taking notes on videos outside of my class. Watched this vid like several weeks ago and I wrote down code about the "Complex" number problem and little did I know, a similar problem like that would appear on my midterm (that I'm taking rn at the time of this comment).

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

    your web site and videos are so explanatory!! thank you :)

  • @creativecodz
    @creativecodz 3 роки тому +1

    superb classes sir. thanks for making such amazing python class videos.
    one request sir if possible please make videos on real-time projects with explanations for beginners. so that we will be more confident in programming.
    once again thanks a million sir

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

    class triangle:
    def __init__(self,a,b,c):
    self.a=a
    self.b=b
    self.c=c
    def perimeter(self):
    p=self.a+self.b+self.c
    return p
    t1=triangle(1,2,3)
    t2=triangle(4,5,6)
    p1=t1.perimeter()
    p2=t2.perimeter()
    print(f"Perimeter for first triangle = {p1}")
    print(f"Perimeter for second triangle = {p2}")

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

    class triangle:
    def __init__(self, side1,side2,side3):
    self.side1 = side1
    self.side2 = side2
    self.side3 = side3
    def cal_perimeter(self):
    p = self.side1+self.side2+self.side3
    print (p)
    t1 = triangle(4,7,6)
    t1.cal_perimeter()

  • @John-eq5cd
    @John-eq5cd 3 роки тому

    Very clear, well worth watching. Thank you

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

    Great video. Wish you the best & success!!

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

    FINALLY!!! ....An Indian I can understand. Awesome video!

  • @kaila-annguiste1472
    @kaila-annguiste1472 2 роки тому

    so clear and easy to understand quick!

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

    Thank you Sir ,You are a good teacher clearly explained

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

    wonderful!!! Love from Bangladesh, Brother!!!

  • @chinecheremchima-w1e
    @chinecheremchima-w1e Рік тому

    Thanks for making this video, and also for the mobile app.

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

    class Triangle:
    def __init__(self, a, b, c):
    self.a = a
    self.b = b
    self.c = c
    pass
    def perimeter(self):
    return (self.a+self.b+self.c)
    t1 = Triangle(3, 4, 5)
    print(t1.perimeter())

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

    Very clear videos. These concepts can be quite confusing (because of all the code jargon that programmers use).

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

    very clear... i hve subscribed keep up the good work

  • @JH-KU
    @JH-KU 3 роки тому

    Thank you. very well organized and explained. Well done.

  • @rajwalavalkar7208
    @rajwalavalkar7208 3 роки тому +1

    couta>>b>>c; sir, what is equivalent python code for this c++ code? plz reply!

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

    I'm lost on this one, great course thus far but somehow went to another level without any defining on how you got there with this one.

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

    Thank you, this video is so helpful and easy to understand

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

    very simple and to the point... thanks for making the concept easier

  • @derikaem8021
    @derikaem8021 3 роки тому +1

    great explanation!
    is there a way to have several init functions, so that you can construct an object with a variable number of attributes?

  • @gabrielnino2892
    @gabrielnino2892 4 роки тому +2

    This is so helpful! thank you!

  • @0009madhu
    @0009madhu 2 роки тому

    Hello,
    Where is the code for triangle program? No link in the description

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

    Very easy to follow, thanks for explaining!

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

    thanks, I finally understood it now

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

    Hi, I have modified the code by a bit by asking the values of each side to count the perimeter instead of asigning it so the code is here
    class Triangle:
    def __init__(self,a,b,c):
    self.a = a
    self.b = b
    self.c = c
    def perimeter(self):
    perimeter_nums = [self.a,self.b,self.c]
    perimeter_value = sum(perimeter_nums)
    return perimeter_value
    value1 = int(input("Enter the first value: "))
    value2 = int(input("Enter the second value: "))
    value3 = int(input("Enter the third value: "))
    result = Triangle(value1,value2,value3).perimeter()
    print("The perimeter of your given Tiriangle is", result)

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

    Sir i have a doubt what is constructor
    And how to use class and objects of python by using a constructor???

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

    Awesome explanation

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

    thank you, sir interesting and very helpful for me

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

    I love your videos. Do you have any tips to getting even better at Python for someone like me who could be described as an intermediate python programmer. I want to really advance to the next level but I feel somewhat stuck on what I could be doing with what I currently know about Python.

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

    Does your app have lessons from your videos or how does it work

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

    Just Awesome and super interestingly genuine way of teaching...So thankful to u brother..also please post videos on data science or AI related too if u can ..thank you

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

    #Triangle Object
    class Triangle:
    def __init__(self, a, b, c):
    self.a = a
    self.b = b
    self.c = c

    def isTriangle(self):
    return (self.a + self.b) > self.c and (self.a + self.c) > self.b and (self.b + self.c) > self.a

    def isRightTriangle(self):
    a1 = max(self.a, self.b, self.c)
    c1 = min(self.a, self.b, self.c)
    b1 = sum([self.a, self.b, self.c]) - (a1 + c1)
    return a1**2 == sum([b1**2, c1**2])

    def perimeter(self):
    return self.a + self.b + self.c
    def area(self):
    #heron's formula
    p = self.perimeter()/2

    return (p*(p-self.a)*(p-self.b)*(p-self.c))**0.5

  • @Aditya-qx7nf
    @Aditya-qx7nf 4 роки тому

    Sir , you explain really well. Can you please explain tuple slicing ?

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

    Great video and lesson on this topic. I am a new follower. Where can we post questions?

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

    n1,n2 are two objects is not allowed arguments sir output has a error pls help me

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

    very well explained

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

    Very clear! Thank you so much sir

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

    The way you explain ❤️

  • @sharanchandrasekaran8399
    @sharanchandrasekaran8399 10 місяців тому

    Great video, thank you

  • @ashisdas5376
    @ashisdas5376 4 роки тому +2

    I was waiting for it