Coding Exercise for Beginners in Python with solution | Exercise 26 | Python for Beginners

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 95

  • @rupayadav256
    @rupayadav256 Рік тому +16

    After watching your OOP's videos lecture, I am able to write code by myself and m feeling so confident. A million thanks to you. Thanks for shaping my knowledge.

  • @chilkurisasenderreddy6607
    @chilkurisasenderreddy6607 Рік тому +29

    class rectangle:
    def __init__(self,width,length):
    self.width=width
    self.length=length
    def area(self):
    return self.width*self.length
    a=int(input("Enter length of rectangle: "))
    b=int(input("Enter breadth of rectangle: "))
    rectangle_1=rectangle(a,b)
    print(f"the area of rectangle :{rectangle_1.area()}")

  • @ayeshawaheed2248
    @ayeshawaheed2248 Рік тому +2

    Having watched your Python video lectures, I now feel confident in writing code independently. I want to express my gratitude for your guidance. Thank you so much for your valuable teachings.

  • @sowbaranikag6514
    @sowbaranikag6514 Рік тому +2

    class Rectangle:
    def __init__(self,length,breadth) -> None:
    self.rectLength = length
    self.rectBreadth = breadth

    def rectArea(self):
    return self.rectLength * self.rectBreadth

    rect1 = Rectangle(int(input("Length: ")) , int(input("Breadth: ")))
    print("Area: " , rect1.rectArea())
    Thankyou so much mam, you are helping us understand so so so clearly! Thanks a lot!

  • @flipdruid
    @flipdruid 8 місяців тому

    The best OOP tutorial every, simplified and very clear explanation.

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

    class Rectangle:
    def __init__(self, base, height):
    self.base = base
    self.height = height
    def area(self):
    return self.base * self.height
    rectangle_1 = Rectangle(10, 4)
    print(rectangle_1.area())

  • @shivakrishna_varma9658
    @shivakrishna_varma9658 4 місяці тому +1

    class Rectangle:
    def __init__(self,l,w):
    self.area=l*w
    rectangle_1=Rectangle(10,5)
    print("Area of rectangle 1 is: ",rectangle_1.area)

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

    class Rectangle:
    def __init__(self,length,breadth): # l=5,b=4
    self.length = length
    self.breadth = breadth
    def area(self):
    return self.length*self.breadth

    print(Rectangle(5,4).area())

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

    class Rectangle:
    def __init__(self, length, breadth):
    self.length = length
    self.breadth = breadth
    def area(self):
    return self.length * self.breadth
    area_of_rectangle = Rectangle(4, 5)
    print('Area of rectangle:', area_of_rectangle.area(), 'sq.units')

  • @DanushkaChanaka-z6u
    @DanushkaChanaka-z6u Рік тому

    Excellent explanation. Thanks you very much for giving this valuable knowledge. love from srilanka

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

    Practice is important in coding journey.

  • @white-hat666
    @white-hat666 5 місяців тому +1

    class rectangle:
    def __init__(self,height,width):
    self.Height=height
    self.Width=width
    self.area=self.Height * self.Width
    rectangle_1=rectangle(int(input("Enter height of the rectangle:")),int(input("Enter width of the rectangle:")))
    print(rectangle_1.area)

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

    class Rectangle:
    def __init__(self,l,b):
    self.l=l
    self.b=b
    def area_of_rectangele(self):
    return self.l*self.b
    def circum_of_rectangle(self):
    return (2*self.l)+(2*self.b)
    rect1=Rectangle(2,4)
    print(f"Area of Rectangle is {rect1.area_of_rectangele()}")
    print(f"Circumference of Rectangle is {rect1.circum_of_rectangle()}")

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

    class rectangle():
    l= 50
    b= 30
    def __init__(self):
    self.area_rec= 2* (self.l + self.b)
    area_rectangle= rectangle()
    print(area_rectangle.area_rec)

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

    It's hard to grasp the thing starting at 10:04. I mean why not passing the area as a parameter but the radius yes? Could anyone explain?

    • @JennyslecturesCSIT
      @JennyslecturesCSIT  Рік тому +2

      We have to find area using formula. How can you pass area as a parameter... We don't know in advance what the area of circle is..we only pass radius

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

      ​@@JennyslecturesCSITI thought we can pass the area as a parameter without giving it a default value

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

    Area of rectangle:
    class Area:
    def __init__(self,length,breadth):
    self.length = length
    self.breadth = breadth
    self.final_area = self.length * self.breadth
    def display(self):
    print(f"The area of rectangle is {self.final_area}")
    object_1 = Area(4,3)
    object_1.display()

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

    Most usefull your explanation madam ♡♥♡Love you Madam ❤😘😘😘

  • @sayyedirshad9941
    @sayyedirshad9941 3 місяці тому

    class circle:
    def area(self,radius):
    print(f"the area is {3.14*radius**2}")
    def circumference(self,radius):
    print(f"the circumference of the circle is {2*3.14*radius}")
    c=circle()
    c.area(2)
    c.circumference(3)

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

    East or west jenny madam is the best🎉 for python

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

    class Rectangle:
    def __init__(self,length,breadth):
    self.area = length*breadth
    def display(self):
    print(f"The area of rectangle is {self.area} sq.units.")
    rectangle_1 = Rectangle(20,12)
    rectangle_1.display()
    rectangle_2 = Rectangle(30,15)
    rectangle_2.display()

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

    Where to get notes from?

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

    class rectangle:
    def __init__(self,length,width):
    self.length=length
    self.width=width
    def get_area_of_rectangle(self):
    return self.length * self.width
    rectangle_1=rectangle(4,5)
    print(f'The area of rectangle is: {rectangle_1.get_area_of_rectangle()}')
    This Python code defines a class named rectangle that represents a rectangle. The class has two methods:
    __init__(self, length, width): This is the constructor method that’s called when you create a new instance of the class. It takes two parameters - length and width, and assigns them to the instance variables self.length and self.width.
    get_area_of_rectangle(self): This method calculates the area of the rectangle by multiplying the length and width of the rectangle (self.length * self.width).
    After defining the class, the code creates an instance of the rectangle class with length 4 and width 5 (rectangle_1 = rectangle(4,5)).
    Finally, it prints the area of rectangle_1 by calling the get_area_of_rectangle method (rectangle_1.get_area_of_rectangle()).
    So, if you run this code, it will print: The area of rectangle is: 20, because the area of a rectangle with length 4 and width 5 is 20 (4*5).

  • @ManishaLohani-ve8rl
    @ManishaLohani-ve8rl 2 місяці тому

    class Rectangle:
    def __init__(self,length,breadth):
    self.length=length
    self.breadth=breadth
    def area(self):
    return self.length*self.breadth
    rect_1=Rectangle(2,4)
    print(rect_1.area())

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

    Informative video 😊😊❤

  • @SindhujaReddy-gw7fo
    @SindhujaReddy-gw7fo 9 місяців тому

    class area:
    def __init__(self,radius):
    pie=3.14
    self.radius=radius
    self.areaa=pie*radius**2
    self.circum=2*pie*radius
    area1=area(14)
    print(area1.areaa)
    print(area1.circum)

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

    ma'am I need to dump 5 mins option data from maticalgos websites for every strikes for a particular data

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

    class rectangle:
    l=3
    b=7
    def __init__(self):
    self.area=rectangle.l*rectangle.b
    object=rectangle()
    print(object.area)

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

    class Rectangle:
    def __init__(self,len,wid):
    self.length = len
    self.width = wid
    self.area = len * wid
    rect = Rectangle(4,5)
    print(rect.area)

  • @shivanijha8063
    @shivanijha8063 Рік тому +3

    Mam plzz make a playlist of Core java plzz mam plzzz....its huge request

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

    class Rectangle:
    def __init__(self, length, width):
    self.length = length
    self.width = width
    def get_rectangle_area(self):
    area = self.length * self. width
    return area
    length= float(input("Enter the length"))
    width = float(input("Enter the width"))
    rectangle_1 = Rectangle(length, width)
    print(rectangle_1.get_rectangle_area())

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

    #class_rectangle
    class rectangle:
    def __init__(self,l,b):
    self.len=l
    self.wid=b
    def area(self):
    area=self.len*self.wid
    return(area)
    r=rectangle(2,3)
    print(r.area())

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

    Thanks for the video madam

  • @arunkumarkurapati8093
    @arunkumarkurapati8093 25 днів тому

    # Find area and circumference of a circle usinf OOP concept
    rad = float(input("Enter radius: "))
    class Calculation:
    pi = 3.14
    def __init__(self,rad):
    self.r = rad
    def area_of_circle(self):
    area = self.pi*self.r*self.r
    print(f"Area of circle: {area}")
    def circum_of_circle(self):
    circum = 2*self.pi*self.r
    print(f"Circumference of a circle: {circum}")
    area = Calculation(rad)
    circum = Calculation(rad)
    area.area_of_circle()
    circum.circum_of_circle()

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

    Class Rectangle:
    def __init___(self,l,w):
    self.length=l
    self.width=w
    def get_area(self):
    area=self.length*self.width
    return area
    rectangle_1=Rectangle (5,6)
    Print (rectangle_1.get_area())

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

    thank you so much 🥰

  • @sumairakhurram2478
    @sumairakhurram2478 9 місяців тому

    Jenny mam plz upload videos for concept of association in OOP. It is very difficult

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

    class Rectangle:
    def __init__(self,length,width):
    self.length=length
    self.width=width
    def area(self):
    Area=self.length*self.width
    return Area
    rectangle_1=Rectangle(5,10)
    rectangle_2=Rectangle(5,20)
    rectangle_3=Rectangle(5,30)
    print(rectangle_1.area())

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

    Ma'am can we do same thing for circumference also.........???

  • @ManishaMick-kw9pb
    @ManishaMick-kw9pb 19 днів тому

    class Rectangle:
    def __init__(self,l,w):
    self.length=l
    self.width=w
    def area(self):
    area=self.length*self.width
    print(f"Area : {area}")
    rectangle1=Rectangle(int(input("Enter Length: ")),int(input("Enter Width: ")))
    rectangle1.area()

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

    This is my exercise, only difference is i wrote a method for finding the area too
    #!/usr/bin/python3
    class Circle:
    pi = 3.14
    def __init__(self, radius):
    self.radius = radius
    def circumference(self):
    circum = 2 * self.pi * self.radius
    return circum

    def area(self):
    a = self.pi * (self.radius ** 2)
    return a
    circle_1 = Circle(4)
    print(circle_1.circumference())
    print(circle_1.area())
    circle_2 = Circle(14)
    print(circle_2.circumference())

  • @VishnuVardhan-dp7hu
    @VishnuVardhan-dp7hu Рік тому

    class Rectangle :
    def __init__(self, height, width):
    self.height = height
    self.width = width
    def area_of_rectangle(self):
    area = self.height * self.width
    return area
    Rectangle_1 = Rectangle(6,3)
    print(Rectangle_1.area_of_rectangle())

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

    class Rectangle:
    def __init__(self,length,breadth):
    self.length=length
    self.breadth=breadth
    def area(self):
    return self.length*self.breadth
    rectangle_1=Rectangle(5,6)
    print(f"The area of rectangle is {rectangle_1.area()}")

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

    class Rectangle1:
    def __init__(self,l=4,w=2):
    self.length=l
    self.width=w
    def get_area(self): # get_area is a method
    return self.length*self.width
    rectangle_a=Rectangle1(5,3)
    print(f"Area of rectangle a is: {rectangle_a.get_area()}")

  • @sridharprincesridharprince8986

    Hello It a informative video 😊

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

    class Area:
    def __init__(self,area):
    self.radius = area
    self.final_area = 3.141592653589793 * (self.radius) ** 2
    self.final_circumference = 2 * 3.141592653589793 * (self.radius)
    def display(self):
    print(f"The area of circle is {self.final_area}")
    print(f"The circumference of circle is {self.final_circumference}")
    object_1 = Area(4)
    object_1.display()

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

    Homework Solution
    class Rectangle():
    def __init__(self,length,breadth):
    self.length=length
    self.breadth=breadth
    def areaRect(self):
    return self.length * self.breadth
    def perimeterRect(self):
    return 2 * (self.length + self.breadth)
    rectangle_1=Rectangle(2,4)
    print(rectangle_1.areaRect())
    print(rectangle_1.perimeterRect())

  • @baratammanojkumar8410
    @baratammanojkumar8410 8 місяців тому

    Class Rectangle :
    def __init__(self,length,width)
    Self.length=length
    Self.width=width
    def area(self)
    return length*width
    a=int(input("enter length"))
    b=int(input("enter width"))
    Rect_1=Rectangle (a,b)
    Print("area=",Rect_1.area)

  • @BepositiveBro9
    @BepositiveBro9 9 місяців тому

    class rectangle:
    def __init__ (self,length,width):
    self.length=length
    self.width=width
    def get_area(self):
    return self.length * self.width
    def get_circumference(self):
    return 2 * (self.length + self.width)
    rectangle1=rectangle(4,5)
    print(f"The area of the rectangle1 is {rectangle1.get_area()}")
    print(f"The circumference of the rectangle1 is {rectangle1.get_circumference()}")

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

    Mam when will the course complete

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

    1)
    class Circle:
    pi=3.14
    def __init__(self,radius):
    self.radius=radius
    def area(self):
    a=self.pi* self.radius **2
    print(f"Area of circle is :{a}")
    def circum_1(self):
    c=2* self.pi *self.radius
    print(f"Circumference of circle 1 is :{c}")
    def circum_2(self,c_2):
    circum2=2* self.pi * c_2
    print(f"Circumference of circle 2 is :{circum2}")
    maths=Circle(4)
    maths.area()
    maths.circum_1()
    maths.circum_2(14)
    2)
    class AreaOfRectangle:
    def __init__(self,length,width):
    self.length=length
    self.width=width
    def Area(self):
    math=self.length * self.width
    print(f"Area of Rectangle is :{math}")
    calculation=AreaOfRectangle(3,4)
    calculation.Area()

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

    class Rectangle:
    def __init__(self,length,breadth):
    self.length=length
    self.breadth=breadth
    self.area=self.length*self.breadth
    def Perimeter(self):
    peri=2*(self.length+self.breadth)
    return peri
    T1=Rectangle(10,4)
    print(f'Perimeter of Rectangle is {T1.Perimeter()}')
    print(f'area of rectangle is {T1.area}')

  • @sigmatronX
    @sigmatronX 9 місяців тому

    class Rectangle:
    def __init__(self, length, width):
    self.length=length
    self.width=width
    def area_rect(self):
    return self.length * self.width
    area_rectangle = Rectangle(4, 5)
    print(f"The area of the rectangle is: {area_rectangle.area_rect()}")

  • @anjalileo9385
    @anjalileo9385 11 місяців тому

    class Area:
    def __init__(self,l,b):
    self.len=l
    self.bre=b
    def rect(self,name):
    a= 2*(self.len+self.bre)
    print(f"the area of {name} is {a}")
    rectangle=Area(2,3)
    (rectangle.rect("rectangle"))

  • @sanjaysrivatsav7443
    @sanjaysrivatsav7443 6 місяців тому

    class Triangle:
    val=0.5
    def __init__(self,base,height):
    self.base=base
    self.height=height
    def get_area(self):
    return Triangle.val*self.base*self.height
    triangle_1=Triangle(2,4)
    triangle_2=Triangle(3,6)
    triangle_3=Triangle(4,8)
    print(triangle_1.get_area())
    print(triangle_2.get_area())
    print(triangle_3.get_area())

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

    class Rectangle:
    def __init__(self,l,w):
    self.lenght=l
    self.width=w
    def get_area(self):
    return self.lenght * self.width
    rec1=Rectangle(4,5)
    print(f"Rectangle1 lenght = {rec1.lenght}")
    print(f"Rectangle1 width = {rec1.width}")
    print(f"Area of Rectangle1 is {rec1.get_area()} ")
    rec2=Rectangle(6,8)
    print(f"Area of Rectangle2 is {rec2.get_area()}")

  • @azarudeena6467
    @azarudeena6467 9 місяців тому

    class Area:
    def __init__(self,length,breadth,base,height):
    self.length = length
    self.breadth = breadth
    self.base = base
    self.height = height
    def rectangle(self):
    return f"The area of rectangle is {self.length} * {self.breadth} = {self.length * self.breadth}"
    def triangle(self):
    return f"The area of triangle is 1/2 * {self.base} * {self.height} = {1/2 * self.base * self.height} "
    area1 = Area(length=4,breadth=2,base=5,height=6)
    print(area1.rectangle())
    print(area1.triangle())

  • @suchirganesh.j2609
    @suchirganesh.j2609 15 днів тому

    import math
    class Circle:
    def __init__(self,radius):
    self.radius = radius
    self.pi = math.pi

    def area(self):
    return (self.pi*(self.radius**2))

    def circumference(self):
    return (2*self.pi*self.radius)
    class Rectangle:
    def __init__(self,length,breadth):
    self.length = length
    self.breadth = breadth

    def area (self):
    return self.length*self.breadth

    rec = Rectangle(10,20)
    print(rec.area())

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

    Mam ap mera reply ku nahi de rahi ho mai such me coding sikna chahata hu please help me

  • @BepositiveBro9
    @BepositiveBro9 9 місяців тому

    class triangle:
    def __init__(self,side1,side2,side3,height):
    self.side1=side1
    self.side2=side2
    self.side3=side3
    self.height=height
    def get_circumference(self):
    return self.side1+self.side2+self.side3
    def get_area(self):
    return 1/2 * self.side2 * self.height
    triangle1=triangle(1,2,3,8)
    print(f"The circumference of the triangle1 is {triangle1.get_circumference()}")
    print(f"The area of the triangle1 is {triangle1.get_area()}")

  • @BepositiveBro9
    @BepositiveBro9 9 місяців тому

    class square:
    def __init__(self,side):
    self.side=side
    def get_circumference(self):
    return 4 * self.side
    def get_area(self):
    return self.side * self.side
    square1=square(5)
    print(f"The circumference of square1 is {square1.get_circumference()}")
    square2=square(6)
    print(f"The circumference of square2 is {square2.get_circumference()}")
    print(f"The area of square1 is {square1.get_area()}")
    print(f"The area of square2 is {square2.get_area()}")

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

    import math
    pie= 3.14
    class Circle:
    def __init__(self,radius):
    self.area=pie*radius**2
    self.circumference=2*pie*radius
    radius=Circle(float(input("entre the radius:")))
    print("Radius of Circle is:",math.ceil(radius.area))
    print(f"circumference of circle is {radius.circumference}")

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

      import math
      class Rectangle():
      def __init__(self,length,breadth):
      self.area=length*breadth
      length=int(input("Enter length:"))
      breadth=int(input("Enter breadth:"))
      area_cal=Rectangle(length,breadth)
      print("Area of Rectangle is:",math.ceil(area_cal.area))

  • @Venkatesh-q1d
    @Venkatesh-q1d Рік тому

    Mam plz. Explain python file handling and tkinter package

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

    I want to start the career in python...what is the best way to learn mam...can you please give me a suggestion....mam please.....

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

      There is no the best way kinda thing...just start learning from a good resource and you will get ur way ultimately 👍

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

      Can YOU TELL .. WHERE WE GET THE RESOURCE..HOW

  • @Tecresearch-a
    @Tecresearch-a Рік тому

    I am the first viewer ❤

  • @azarudeena6467
    @azarudeena6467 9 місяців тому

    class Circle:
    pi = 3.14
    def __init__(self,radius):
    self.radius = radius
    def area(self):
    return f"Area of circle is {Circle.pi} * {circle1.radius} * {circle1.radius} = {Circle.pi * circle1.radius * circle1.radius}"
    def circumference(self):
    return f"circumference of circle is {2 * Circle.pi * self.radius}"
    circle1 = Circle(4)
    print("circle1:",circle1.area())
    print("circumference:",circle1.circumference())

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

    Mam please start next php journey after python series

  • @ashwinibandi1126
    @ashwinibandi1126 11 місяців тому

    Mam I'm getting type error

  • @GurjantSingh-bg1bh
    @GurjantSingh-bg1bh Рік тому

    ❤❤

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

    init method is not supported by mobile phone 😢😢😢😢😢

  • @IHS-u5c
    @IHS-u5c Рік тому

    😱😱

  • @Manish-fo7il
    @Manish-fo7il Рік тому

    Maine cs ni li hai phir b apki videos dekhta hu🤭

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

    Mam I from entc branch can I get software job in us

  • @k.v.rohithsai2495
    @k.v.rohithsai2495 2 місяці тому

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

    Madam muje tho ek doubt aaya . kitne class left hai madam. Python kab katham hojatha madam.

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

      15-20 classes

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

      @@JennyslecturesCSIT Thank you madam
      I have completed my intermediate and looking for some interested things and I have got this python playlist .Iam happy to have this interested python course. Thank you madam for teaching this valuable programming language .

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

    Mam, What's your Age ??

  • @SantoshSasmal-z1j
    @SantoshSasmal-z1j Рік тому

    Mam ap bahut look gossage

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

    Mam ,you can explain in Hindi

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

    Hello!🔥🔥
    Nice video💥💥
    I'm thumbnail designer and wanted to work with you for that to grow your channel up❤️❤️

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

    madam answer dedho madam pls......

  • @user-py1vm7zx2z
    @user-py1vm7zx2z Рік тому

    You are not hired by Unacadamey ? Or PW ?

  • @shiv_gourav
    @shiv_gourav 6 місяців тому

    88✅

  • @Manideep.9900
    @Manideep.9900 2 місяці тому +1

    class rectangle():
    def __init__(self,l,b):
    self.length=l
    self.breadth=b
    self.area=l*b

    rectangle=rectangle(4,20)
    print (rectangle.area)

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

    class Rectangle:
    def __init__(self, base, height):
    self.base = base
    self.height = height
    def area(self):
    return self.base * self.height
    rectangle_1 = Rectangle(10, 4)
    print(rectangle_1.area())

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

    class rectangle:
    def __init__(self,width,length):
    self.width=width
    self.length=length
    def area(self):
    return self.width*self.length
    a=int(input("Enter length of rectangle: "))
    b=int(input("Enter breadth of rectangle: "))
    rectangle_1=rectangle(a,b)
    print(f"the area of rectangle :{rectangle_1.area()}")