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.
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.
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!
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)
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()}")
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()
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)
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).
# 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()
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())
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()}")
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()}")
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()
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()}")
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()
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}')
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()}")
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"))
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()}")
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()}")
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}")
@@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 .
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.
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()}")
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.
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!
The best OOP tutorial every, simplified and very clear explanation.
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())
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)
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())
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')
Excellent explanation. Thanks you very much for giving this valuable knowledge. love from srilanka
Practice is important in coding journey.
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)
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()}")
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)
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?
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
@@JennyslecturesCSITI thought we can pass the area as a parameter without giving it a default value
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()
Most usefull your explanation madam ♡♥♡Love you Madam ❤😘😘😘
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)
East or west jenny madam is the best🎉 for python
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()
Where to get notes from?
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).
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())
Informative video 😊😊❤
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)
ma'am I need to dump 5 mins option data from maticalgos websites for every strikes for a particular data
class rectangle:
l=3
b=7
def __init__(self):
self.area=rectangle.l*rectangle.b
object=rectangle()
print(object.area)
class Rectangle:
def __init__(self,len,wid):
self.length = len
self.width = wid
self.area = len * wid
rect = Rectangle(4,5)
print(rect.area)
Mam plzz make a playlist of Core java plzz mam plzzz....its huge request
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())
#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())
Thanks for the video madam
# 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()
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())
thank you so much 🥰
Jenny mam plz upload videos for concept of association in OOP. It is very difficult
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())
Ma'am can we do same thing for circumference also.........???
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()
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())
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())
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()}")
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()}")
Hello It a informative video 😊
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()
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())
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)
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()}")
Mam when will the course complete
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()
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}')
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()}")
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"))
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())
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()}")
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())
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())
Mam ap mera reply ku nahi de rahi ho mai such me coding sikna chahata hu please help me
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()}")
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()}")
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}")
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))
Mam plz. Explain python file handling and tkinter package
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.....
There is no the best way kinda thing...just start learning from a good resource and you will get ur way ultimately 👍
Can YOU TELL .. WHERE WE GET THE RESOURCE..HOW
I am the first viewer ❤
🎉
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())
Mam please start next php journey after python series
Mam I'm getting type error
❤❤
init method is not supported by mobile phone 😢😢😢😢😢
😱😱
Maine cs ni li hai phir b apki videos dekhta hu🤭
Mam I from entc branch can I get software job in us
Madam muje tho ek doubt aaya . kitne class left hai madam. Python kab katham hojatha madam.
15-20 classes
@@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 .
Mam, What's your Age ??
Mam ap bahut look gossage
Mam ,you can explain in Hindi
Hello!🔥🔥
Nice video💥💥
I'm thumbnail designer and wanted to work with you for that to grow your channel up❤️❤️
madam answer dedho madam pls......
You are not hired by Unacadamey ? Or PW ?
88✅
class rectangle():
def __init__(self,l,b):
self.length=l
self.breadth=b
self.area=l*b
rectangle=rectangle(4,20)
print (rectangle.area)
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())
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()}")