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)
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.
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.
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. 😊
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)
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!
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.
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!
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!
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
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())
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.
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.
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
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.
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🥰.
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
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.
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.
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!!!
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).
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
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}")
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)
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.
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
🔥 Learn Python with a more hands-on experience with Programiz PRO-interactive lessons, quizzes & challenges.
Try Programiz PRO: bit.ly/right-python
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)
the clearest and most well-explained video on classes on UA-cam! Keep up the good work man!
Trueeee
Very true
True
Totally agree!
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.
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.
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. 😊
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)
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())
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!
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.
Finally, a video that clearly explains classes. Thank you!
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!
One of the best tutorials. I also like that you actually added a task at the end to check if we really understand
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())
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.
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!!!
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!
A true master. I have watched your video many times. It is an extremely clear and concise way to teach OOP. Thank you!
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
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.
I just love your way of teaching..it makes everything clear to me.
i love you pundit, everytime i have struggle i come to you and you always execute. love from uzebekistan
- jamal
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())
I have watched many videos but trust me this video is the best i have ever seen.
it's the best video explaining classes and OOP, good methodology and very good job,thanks
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.
Sir! what is self and why we use itm
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 :)
Love the website and tutorials! High-quality content 👌
This video cleared all my doubts, thank you so much, you taught very well
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())
I am still confused on the [15:27] line 14, the way we called the add method...
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.
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
Great work! Keep up the spirit and this channel will grow very soon.
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.
I am glad I came across your channel , you explain in a very simple way . Way to go , keep rocking
You the awesome trainer for this course in youtube platform ,really you explained all the topics with theory and code. Keep going on
Thank you so so much for breaking Class down to be understandable. I am indeed grateful.
A lot of people must have said thank you but I will like to say it again. Thank you!
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🥰.
I got understand after many days 🙏❤️...but love this 💙💙💙
This is was the most useful tutorial for classes and objects , thank you!
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
Great video! You are very skillful at teaching the information and progressing the difficulty, loved the video!! Thank you very much
Your Videos are awesome, Man. Maybe it is not know to many.. I strongly believe you will succeed in u r mission
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())
Keep it up sir... your way of expression and methods are amazing
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.
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.
Thank you... Now I got clarity on OOP
I am your fan now! Regret that I should check this simplest version first : )Thanks A Lot
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.
Very well explained! Thank you for great work.Can't wait for the upcoming videos.
This was an excellent video. It explained creation of objects so well. Thank you so much
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!!!
The concept is explained very clearly.. 😊
thanks buddy it was fantastic
Where to get the solutions??? Of the task you gave
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).
your web site and videos are so explanatory!! thank you :)
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
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}")
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()
Very clear, well worth watching. Thank you
Great video. Wish you the best & success!!
FINALLY!!! ....An Indian I can understand. Awesome video!
so clear and easy to understand quick!
Thank you Sir ,You are a good teacher clearly explained
wonderful!!! Love from Bangladesh, Brother!!!
Thanks for making this video, and also for the mobile app.
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())
Very clear videos. These concepts can be quite confusing (because of all the code jargon that programmers use).
very clear... i hve subscribed keep up the good work
Thank you. very well organized and explained. Well done.
couta>>b>>c; sir, what is equivalent python code for this c++ code? plz reply!
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.
Thank you, this video is so helpful and easy to understand
very simple and to the point... thanks for making the concept easier
great explanation!
is there a way to have several init functions, so that you can construct an object with a variable number of attributes?
This is so helpful! thank you!
Hello,
Where is the code for triangle program? No link in the description
Very easy to follow, thanks for explaining!
thanks, I finally understood it now
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)
Sir i have a doubt what is constructor
And how to use class and objects of python by using a constructor???
Awesome explanation
thank you, sir interesting and very helpful for me
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.
Does your app have lessons from your videos or how does it work
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
#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
Sir , you explain really well. Can you please explain tuple slicing ?
Great video and lesson on this topic. I am a new follower. Where can we post questions?
n1,n2 are two objects is not allowed arguments sir output has a error pls help me
very well explained
Very clear! Thank you so much sir
The way you explain ❤️
Great video, thank you
I was waiting for it