Python Inheritance (Make Your Code Modular!) #22

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

КОМЕНТАРІ • 39

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

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

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

    Just brilliant! I have understood everything as a complete beginner. Thank you!

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

    Your videos are so underrated, have learnt complex topics like OOPS in a matter of few days. Thanks

  • @danielnelson8592
    @danielnelson8592 4 роки тому +9

    Programiz is a good place to learn. Thanks a lot for your help

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

    Can you please continue this series it clears the doubts so much with such an ease. Thanks for the video and please please please upload more such videos

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

    Too good ! Please add lectures on Abstraction, Encapsulation and Polymorphism also.

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

    Correction at 03:43 - It should be *Object of Dog Class*
    Not Animal class
    Because objects of the Animal class does not have access to attributes and methods of Dog Class.

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

    super explanation. Nothing was getting inside my mind before watching this. really wonderfull!!

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

    Please make videos on Multiple Inheritance and Operator overloading as well

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

    Can you please continue the series sir ,its easy to understand the way you teach

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

    This is the first Indian guy that I actually enjoy listening.

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

    Thanks for all your info truly amazing....Bless up and keep up the Great Work....

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

    I clearly understand the OOP here. Thanks dude.!

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

    Respect your content 😊😊

  • @Rameshkumar-tn3wp
    @Rameshkumar-tn3wp 3 роки тому +1

    Simple explanation , thanks...

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

    Thank you! This was a very helpful video

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

    Your explanation is really very good
    Please make all videos on Oops concept s

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

    Happy Programming!😇

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

    class polygon():
    def __init__(self, sides):
    self.sides = sides
    def display_info(self):
    print("the polygon is a two dimensional shape with straigt lines")
    def get_perimeter(self):
    perimeter = sum(self.sides)
    return perimeter
    class triangle(polygon):
    def display_info(self):
    print("the triangle is three sides of edges")
    class quadlilateral(polygon):
    def display_info(self):
    print("the quadlilateral is four sides of edges")
    t1 = triangle([3,4,5])
    perimeter = t1.get_perimeter()
    print("The perimeter is", perimeter)
    here showed that the triangle has get_perimeter attributes, but I can't fix the error. Can u please help me?

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

      you didnt give space known as indendation in the class polygon methods if you space in methods of the class polygon your program will correct

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

    great explanation

  • @omkarpanda3906
    @omkarpanda3906 4 роки тому +3

    waiting for abstraction and encapsulation #askprogrammiz

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

    Which text editor do you guys use?😀 #askprogramiz

  • @OmarMohamed-it8ly
    @OmarMohamed-it8ly 3 роки тому

    This helped me so much...thank you

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

    Can u please create one video about polymorphism, encapsulation and abstraction please...

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

    What is this class... when will u start Python modules??

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

    Yeah, this is getting hard... :D

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

    Should we have to give "object" to function name ??
    Here dog1 for dog?

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

    what does argument (self) mean ?

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

    10:11 why comma and not dot??

    • @programizstudios
      @programizstudios  3 роки тому +10

      We use comma in the print() function to print multiple objects. For example,
      print("Hello", "there")
      And, the . operator is used to access methods and attributes of an object. For example,
      my_list = [1, 2, 3]
      my_list.append(4)
      print(my_list)

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

    Thanks alot;)

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

    Always make sure that the spelling of every word must be correct.

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

    IS THIS CODE RIGHT????
    marks = int(input("enter your marks:"))
    number_of_subjects = int(input("enter no. of subjects:"))
    class marks_obtained():
    def __init__(self,name,marks,number_of_subjects):
    self.name = name
    self.marks = marks
    self.number_of_subjects = number_of_subjects
    def percent_obtained(self):
    total = self.marks/self.number_of_subjects
    percentile = total*100
    print("self.name has scurred :" ,percentile)
    return percentile
    def rank_securred(self):
    if percentile >=90:
    print("self.name has got an A ")
    elif 90 >percentile>=80:
    print("self.name has got B")
    else :
    print("self.name has got C")
    return rank
    class student_1(marks_obtained):
    pass
    c1 = student_1("Harry",marks,number_of_subjects)
    percentile = student_1.percent_obtained()
    rank = student_1.rank_securred()

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

      you dint pass the marks and number of subjects arguments

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

    write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop
    Bro iska source code bata do
    Ya phir kisi ko bhi ata ho toh bata do plz

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

      HOPE THIS HELP!!!
      # write a program to calculate the total amount payable by the customer on purchase of any item with GST lived on it develop a user friendly approach using while loop
      class Amount_payable():
      def __init__(self,name,cost_of_item):
      self.name = name
      self.cost_of_item = cost_of_item
      def total_amount(self):
      GST = 10.3
      if self.cost_of_item > 1000:
      final_amount = self.cost_of_item + GST
      print(final_amount)
      else:
      print("its GST free")
      return pay
      class Customer(Amount_payable):
      pass
      c1 = Customer("janet", 50000)
      pay = c1.total_amount()
      print(pay)
      class Customer2(Amount_payable):
      pass
      c2 = Customer2("harry",100)
      pay = c2.total_amount()
      print(pay)